aboutsummaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-28 17:01:50 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-28 17:01:50 +0000
commit912873399c3897bfc35c6770ef1a13ad6e991bf6 (patch)
tree9f681673e8dbb46686f0845fc5767c113ee80262 /nscd
parent464c9fadafa7e8c30d0e2fd5914e0d6011f1f8ef (diff)
downloadglibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.tar
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.c13
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");