aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pam-freerdp.c9
1 files 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;