diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-06-08 17:19:31 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-06-08 17:19:31 +0000 |
commit | e0ba36baccc0df5a3fa521c3ceb68bb1ffa434b7 (patch) | |
tree | 38e83bc25b2bd9e79f4e501c7a4a16a83d30d75e /gpsd.c | |
parent | 9b8846073f9ebfc8fcff9d42cfe511a08fa14f72 (diff) | |
download | gpsd-e0ba36baccc0df5a3fa521c3ceb68bb1ffa434b7.tar.gz |
Ensure that we don't try to change GID or set the system clock when non-root.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1003,8 +1003,10 @@ int main(int argc, char *argv[]) } #ifdef NTPSHM_ENABLE - (void)nice(-10); /* for precise timekeeping increase priority */ - (void)ntpshm_init(&context, nowait); + if (getuid() == 0) { + (void)nice(-10); /* for precise timekeeping increase priority */ + (void)ntpshm_init(&context, nowait); + } #endif /* NTPSHM_ENABLE */ /* make default devices accessible even after we drop privileges */ |