diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-11-22 05:27:47 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-11-22 05:27:47 +0100 |
commit | 1e5c5ba101e2f48b77bfdbdca220ea8146466cb2 (patch) | |
tree | d357c8d1484f59dc34715d8f3ad0f8944a170ed7 | |
parent | whoops (diff) | |
download | libpassphrase-1e5c5ba101e2f48b77bfdbdca220ea8146466cb2.tar.gz libpassphrase-1e5c5ba101e2f48b77bfdbdca220ea8146466cb2.tar.bz2 libpassphrase-1e5c5ba101e2f48b77bfdbdca220ea8146466cb2.tar.xz |
export env list from PAM
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | src/pam.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -132,6 +132,7 @@ void verify_account_pam(void) void open_session_pam(void) { int rc; + char** env; struct sigaction signal_action; do_pam(pam_setcred(handle, PAM_ESTABLISH_CRED)); @@ -155,6 +156,15 @@ void open_session_pam(void) signal_action.sa_handler = quit_pam; sigaction(SIGHUP, &signal_action, NULL); sigaction(SIGTERM, &signal_action, &signal_action_term); + + for (env = pam_getenvlist(handle); env && *env; env++) + if (putenv(*env)) + { + pam_setcred(handle, PAM_DELETE_CRED); + pam_end(handle, pam_close_session(handle, 0)); + sleep(ERROR_SLEEP); + _exit(1); + } } |