File: 09_pam_session.patch

package info (click to toggle)
wdm 1.28-27.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,540 kB
  • sloc: ansic: 11,438; sh: 1,033; makefile: 377; perl: 32; cpp: 10
file content (33 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Author: Michael Stapelberg <stapelberg@debian.org>
Description: Open the PAM session in the parent process.
 This is necessary when logind is running. pam_systemd communicates with logind
 and sets up a file descriptor that represents the session. When this file
 descriptor is closed, logind will close the session and kill all processes as
 part of that. The file descriptor is marked CLOEXEC, so without this patch,
 the file descriptor gets opened, then wdm exec()s the session and the file
 descriptor is closed, leading to logind immediately killing the session.
 This patch makes wdm do PAM session handling the same way that xdm does it.
Last-Updated: 2013-08-28
Forwarded: not-needed, project is dead upstream

Index: wdm-1.28/src/wdm/session.c
===================================================================
--- wdm-1.28.orig/src/wdm/session.c	2005-03-26 14:57:04.000000000 +0100
+++ wdm-1.28/src/wdm/session.c	2013-08-28 22:08:43.819028300 +0200
@@ -550,6 +550,7 @@
 	WDMDebug("\n");
     }
 #ifdef USE_PAM
+    if (pamh) pam_open_session(pamh, 0);
 #endif    
     switch (pid = fork ()) {
     case 0:
@@ -599,8 +600,6 @@
 		for(i = 0; pam_env && pam_env[i]; i++) {
 			verify->userEnviron = WDMPutEnv(verify->userEnviron, pam_env[i]);
 		}}
-
-		pam_open_session(pamh, 0);
 	}
 #endif
 	if (setuid(verify->uid) < 0)