From ef777fe87288022872c7ca9ae828a150b1e54577 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Sep 2012 08:31:09 -0500 Subject: Using the new function in the open_session function instead of killing directly. --- src/pam-freerdp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index 17b5996..fde3202 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -441,11 +441,6 @@ pid_t session_pid = 0; PAM_EXTERN int pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char ** argv) { - if (session_pid != 0) { - kill(session_pid, SIGKILL); - session_pid = 0; - } - char * username = NULL; char * password = NULL; char * ruser = NULL; @@ -467,6 +462,10 @@ pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char ** argv goto done; } + if (session_pid != 0) { + unpriveleged_kill(pwdent); + } + int sessionready[2]; if (pipe(sessionready) != 0) { retval = PAM_SYSTEM_ERR; -- cgit v1.2.3