Lines 231-236
Link Here
|
231 |
|
231 |
|
232 |
child = fork (); |
232 |
child = fork (); |
233 |
if (child == 0) { /* child shell */ |
233 |
if (child == 0) { /* child shell */ |
|
|
234 |
/* become the new user */ |
235 |
if (change_uid (&pwent) != 0) { |
236 |
pam_close_session (pamh, 0); |
237 |
pam_setcred (pamh, PAM_DELETE_CRED); |
238 |
(void) pam_end (pamh, PAM_ABORT); |
239 |
exit (1); |
240 |
} |
234 |
/* |
241 |
/* |
235 |
* PAM_DATA_SILENT is not supported by some modules, and |
242 |
* PAM_DATA_SILENT is not supported by some modules, and |
236 |
* there is no strong need to clean up the process space's |
243 |
* there is no strong need to clean up the process space's |
Lines 297-302
Link Here
|
297 |
kill (child, SIGTERM); |
304 |
kill (child, SIGTERM); |
298 |
} |
305 |
} |
299 |
|
306 |
|
|
|
307 |
/* Not checking retval on this because we need to call close session */ |
308 |
pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); |
300 |
ret = pam_close_session (pamh, 0); |
309 |
ret = pam_close_session (pamh, 0); |
301 |
if (PAM_SUCCESS != ret) { |
310 |
if (PAM_SUCCESS != ret) { |
302 |
SYSLOG ((LOG_ERR, "pam_close_session: %s", |
311 |
SYSLOG ((LOG_ERR, "pam_close_session: %s", |
Lines 910-922
Link Here
|
910 |
} |
919 |
} |
911 |
} |
920 |
} |
912 |
|
921 |
|
913 |
/* become the new user */ |
|
|
914 |
if (change_uid (&pwent) != 0) { |
915 |
pam_close_session (pamh, 0); |
916 |
pam_setcred (pamh, PAM_DELETE_CRED); |
917 |
(void) pam_end (pamh, PAM_ABORT); |
918 |
exit (1); |
919 |
} |
920 |
#else /* !USE_PAM */ |
922 |
#else /* !USE_PAM */ |
921 |
environ = newenvp; /* make new environment active */ |
923 |
environ = newenvp; /* make new environment active */ |
922 |
|
924 |
|