diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-08-11 19:03:39 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-08-11 19:03:39 -0400 |
commit | a3d56651f5e902554440342062538bfa0d36b4a6 (patch) | |
tree | e48af9af55517041e11d12240ad39f4320b2f91f /gpsd.c | |
parent | 3d4b69634bde2c779ea33d81185859b1b76f28c7 (diff) | |
download | gpsd-a3d56651f5e902554440342062538bfa0d36b4a6.tar.gz |
Revert to old -N behavior of dripping privileges, and explain why.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1989,8 +1989,16 @@ int main(int argc, char *argv[]) gpsd_report(LOG_PROG, "shared-segment creation succeeded,\n"); #endif /* SHM_EXPORT_ENABLE */ - /* drop privileges */ - if (getuid() == 0) { + /* + * Drop privileges. + * + * Yes, the test for this is non-orthogonal and ugly. The problem + * is that there are two calls in the PPS support, way later on, + * that require root (see ntpmshm.c and look for "requires + * root"). We've overloaded -N with the meaning "don't drop + * privileges" pending a better solution. + */ + if (getuid() == 0 && go_background) { struct passwd *pw; struct stat stb; |