diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-17 05:39:55 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-17 05:39:55 -0400 |
commit | 8321b23bb725b098ae1f2220e777dbcfe827d393 (patch) | |
tree | 818b775f7fb204bc20ea3dfc32b216e37658c7f1 /gpsd.c | |
parent | 96621804887d8f800e535dbbaa6e85a482803fee (diff) | |
download | gpsd-8321b23bb725b098ae1f2220e777dbcfe827d393.tar.gz |
Prevent a race between KPPS initialization and privilege dropping.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1984,6 +1984,14 @@ int main(int argc, char *argv[]) } } +#if defined(HAVE_SYS_TIMEPPS_H) + /* + * Wait here until all the thread spawns produced by opening command-line + * PPS devices no longer need root privileges. + */ + gpsd_await_pps_initialization() +#endif /* defined(HAVE_SYS_TIMEPPS_H) */ + /* drop privileges */ if (getuid() == 0) { struct passwd *pw; |