/[hurd]/hurd/libfshelp/exec-reauth.c
ViewVC logotype

Diff of /hurd/libfshelp/exec-reauth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by thomas, Wed Jul 9 19:00:23 1997 UTC revision 1.6 by roland, Tue May 28 23:58:56 2002 UTC
# Line 1  Line 1 
1  /* Setuid reauthentication for exec  /* Setuid reauthentication for exec
2    
3     Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.     Copyright (C) 1995,96,97,2002 Free Software Foundation, Inc.
4    
5     Written by Miles Bader <miles@gnu.ai.mit.edu>,     Written by Miles Bader <miles@gnu.org>,
6       from the original by Michael I. Bushnell p/BSG  <mib@gnu.ai.mit.edu>       from the original by Michael I. Bushnell p/BSG  <mib@gnu.org>
7    
8     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License as     modify it under the terms of the GNU General Public License as
# Line 83  fshelp_exec_reauth (int suid, uid_t uid, Line 83  fshelp_exec_reauth (int suid, uid_t uid,
83    
84        /* STEP 3: Attempt to create this new auth handle. */        /* STEP 3: Attempt to create this new auth handle. */
85        err = auth_makeauth (auth, &ports[INIT_PORT_AUTH],        err = auth_makeauth (auth, &ports[INIT_PORT_AUTH],
86                             MACH_MSG_TYPE_COPY_SEND, 1,                             MACH_MSG_TYPE_COPY_SEND, 1,
87                             eff_uids->ids, eff_uids->num,                             eff_uids->ids, eff_uids->num,
88                             avail_uids->ids, avail_uids->num,                             avail_uids->ids, avail_uids->num,
89                             eff_gids->ids, eff_gids->num,                             eff_gids->ids, eff_gids->num,
# Line 113  fshelp_exec_reauth (int suid, uid_t uid, Line 113  fshelp_exec_reauth (int suid, uid_t uid,
113              goto abandon_suid;              goto abandon_suid;
114    
115            /* Trrrry again...  */            /* Trrrry again...  */
116            err = auth_makeauth (auth, 0, MACH_MSG_TYPE_COPY_SEND, 1,            err = auth_makeauth (auth, 0, MACH_MSG_TYPE_COPY_SEND, 1,
117                                 eff_uids->ids, eff_uids->num,                                 eff_uids->ids, eff_uids->num,
118                                 avail_uids->ids, avail_uids->num,                                 avail_uids->ids, avail_uids->num,
119                                 eff_gids->ids, eff_gids->num,                                 eff_gids->ids, eff_gids->num,
# Line 130  fshelp_exec_reauth (int suid, uid_t uid, Line 130  fshelp_exec_reauth (int suid, uid_t uid,
130        /* Re-authenticate the exec parameters.  */        /* Re-authenticate the exec parameters.  */
131        exec_reauth (newauth, _secure, 0, ports, num_ports, fds, num_fds);        exec_reauth (newauth, _secure, 0, ports, num_ports, fds, num_fds);
132    
133        proc_setowner (ports[INIT_PORT_PROC],        proc_setowner (ports[INIT_PORT_PROC],
134                       eff_uids->num > 0 ? eff_uids->ids[0] : 0,                       eff_uids->num > 0 ? eff_uids->ids[0] : 0,
135                       !eff_uids->num);                       !eff_uids->num);
136    
137      abandon_suid:      abandon_suid:
# Line 145  fshelp_exec_reauth (int suid, uid_t uid, Line 145  fshelp_exec_reauth (int suid, uid_t uid,
145          idvec_free (avail_gids);          idvec_free (avail_gids);
146      }      }
147    
148    if (_secure && secure)    if (secure)
149      *secure = _secure;      *secure = _secure;
150    
151    return err;    return err;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26