summaryrefslogtreecommitdiff
path: root/libfshelp/exec-reauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfshelp/exec-reauth.c')
-rw-r--r--libfshelp/exec-reauth.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libfshelp/exec-reauth.c b/libfshelp/exec-reauth.c
index e6009827..f0600a1c 100644
--- a/libfshelp/exec-reauth.c
+++ b/libfshelp/exec-reauth.c
@@ -1,6 +1,6 @@
/* Setuid reauthentication for exec
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>,
from the original by Michael I. Bushnell p/BSG <mib@gnu.ai.mit.edu>
@@ -130,8 +130,9 @@ fshelp_exec_reauth (int suid, uid_t uid, int sgid, gid_t gid,
/* Re-authenticate the exec parameters. */
exec_reauth (newauth, _secure, 0, ports, num_ports, fds, num_fds);
- if (eff_uids->num > 0)
- proc_setowner (ports[INIT_PORT_PROC], eff_uids->ids[0], 0);
+ proc_setowner (ports[INIT_PORT_PROC],
+ eff_uids->num > 0 ? eff_uids->ids[0] : 0,
+ !eff_uids->num);
abandon_suid:
if (eff_uids)