From 912873399c3897bfc35c6770ef1a13ad6e991bf6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 28 Apr 2006 17:01:50 +0000 Subject: * nis/ypclnt.c (__xdr_ypresp_all): Minor optimization in string handling. Fix typo in comment. --- nscd/connections.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'nscd') 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"); -- cgit v1.2.3