diff options
author | Gary E. Miller <gem@rellim.com> | 2011-03-17 22:15:36 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2011-03-17 22:15:36 -0700 |
commit | 9d165c8f44c5a20b94bdf077300a83b19c274f59 (patch) | |
tree | c1267a73bcd1688764fe43ae4687ea030189b838 /libgpsd_core.c | |
parent | b1ec6a213d401676cdfc62686256e50cc4921a66 (diff) | |
download | gpsd-9d165c8f44c5a20b94bdf077300a83b19c274f59.tar.gz |
Remove the root only interface to chronyd. Document that interface.
Sadly there is no easy way to open a socket to chrony that lives
in /var/run before gpsd drops root. This removes that broken code
and documents the chrony interface.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index a561201d..5d383a51 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -394,19 +394,24 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) char *chrony_path = NULL; gpsd_report(LOG_PROG, "PPS Create Thread gpsd_ppsmonitor\n"); +#ifdef __UNUSED__ + /* sadly root was dropped very early, until a way if found to run this + * before dropping root it will not work. */ if( 0 == getuid() ) { /* only root can use /var/run */ chrony_path = "/var/run/chrony"; - } else { + } else +#endif + { chrony_path = "/tmp/chrony"; } s.sun_family = AF_UNIX; (void)snprintf(s.sun_path, sizeof (s.sun_path), "%s.%s.sock", chrony_path, basename(session->gpsdata.dev.path)); - /* the socket will be either, for root: + /* TODO the socket for root would be * /var/run/chrony.ttyXX.sock - * or for non-root: + * for now it is always * /tmp/chrony.ttyXX.sock */ |