diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-04-28 17:01:50 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-04-28 17:01:50 +0000 |
commit | 912873399c3897bfc35c6770ef1a13ad6e991bf6 (patch) | |
tree | 9f681673e8dbb46686f0845fc5767c113ee80262 /nscd | |
parent | * nscd/connections.c (restart): If we want to switch back to the (diff) | |
download | glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.tar.gz glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.tar.bz2 glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.zip |
* nis/ypclnt.c (__xdr_ypresp_all): Minor optimization in string
handling. Fix typo in comment.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/connections.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nscd/connections.c b/nscd/connections.c index 0de7945235..38d5f817fd 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1873,14 +1873,23 @@ finish_drop_privileges (void) error (EXIT_FAILURE, errno, _("setgroups failed")); } - if (setresgid (server_gid, server_gid, old_gid) == -1) + int res; + if (paranoia) + res = setresgid (server_gid, server_gid, old_gid); + else + res = setgid (server_gid); + if (res == -1) { dbg_log (_("Failed to run nscd as user '%s'"), server_user); perror ("setgid"); exit (4); } - if (setresuid (server_uid, server_uid, old_uid) == -1) + if (paranoia) + res = setresuid (server_uid, server_uid, old_uid); + else + res = setuid (server_uid); + if (res == -1) { dbg_log (_("Failed to run nscd as user '%s'"), server_user); perror ("setuid"); |