diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2012-03-05 05:46:50 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-03-05 05:46:50 -0500 |
commit | d839a54bcd46ed3f664f9fd4113bd1861ad63b78 (patch) | |
tree | d97fd794c092276beb479309ff80bb1307bc6cba /gpsd.c | |
parent | 8bafe65e56874b3ba7dfdb50874fb0b0a26624a1 (diff) | |
download | gpsd-d839a54bcd46ed3f664f9fd4113bd1861ad63b78.tar.gz |
Avoid a spurious error message wen running as non-root.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -2077,23 +2077,23 @@ int main(int argc, char *argv[]) if (pw) (void)setuid(pw->pw_uid); /*@+type@*/ - } - gpsd_report(LOG_INF, "running with effective group ID %d\n", getegid()); - gpsd_report(LOG_INF, "running with effective user ID %d\n", geteuid()); -#if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S) - /* drop root capabilities, except CAP_SYS_TIME for 1PPS support */ - { - cap_t caps = cap_from_text("cap_sys_time=pe"); + #if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S) + /* drop root capabilities, except CAP_SYS_TIME for 1PPS support */ + { + cap_t caps = cap_from_text("cap_sys_time=pe"); - if (!caps) - gpsd_report(LOG_ERR, "cap_from_text() failed.\n"); - else if (cap_set_proc(caps) == -1) { - gpsd_report(LOG_ERR, "cap_set_proc() failed to drop root privs\n"); - cap_free(caps); + if (!caps) + gpsd_report(LOG_ERR, "cap_from_text() failed.\n"); + else if (cap_set_proc(caps) == -1) { + gpsd_report(LOG_ERR, "cap_set_proc() failed to drop root privs\n"); + cap_free(caps); + } } - } #endif /* HAVE_LIBCAP */ + } + gpsd_report(LOG_INF, "running with effective group ID %d\n", getegid()); + gpsd_report(LOG_INF, "running with effective user ID %d\n", geteuid()); #ifdef SOCKET_EXPORT_ENABLE for (i = 0; i < NITEMS(subscribers); i++) |