Re: [chrony-users] File permissions issues using SOCK protocol

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hi Miroslav, all,

in the end I took the idea from here

https://stackoverflow.com/questions/31619445/how-to-create-a-unix-domain-socket-with-specific-access-permissions

and just wrapped the bind call as needed.  Specifically, in
refclock_sock.c, routine sock_initialize:

  mode_t maskCurrent = umask(0);
  if (bind(sockfd, (struct sockaddr *)&s, sizeof (s)) < 0) {
    LOG_FATAL("bind() failed");
    return 0;
  }
  umask( maskCurrent );

That then gives we just world read,write access to those Unix domain
sockets.  Given that I have to build chrony from source anyway, since I
am running on arm9, tweaking the code wasn't so hard.  My original
question was to make sure there wasn't an option in chrony.conf or a cmd
line one to achieve the same thing.

Stuart


-- 
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/