File: support-consolekit-runtime-detection.patch

package info (click to toggle)
slim 1.4.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,780 kB
  • sloc: cpp: 4,383; sh: 202; makefile: 23
file content (38 lines) | stat: -rw-r--r-- 940 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
Description: Don't abort if ConsoleKit fails when using PAM? Logic seems dubious
Forwarded: not-needed

--- a/app.cpp
+++ b/app.cpp
@@ -716,8 +716,13 @@
 			ck.open_session(DisplayName, pw->pw_uid);
 		}
 		catch(Ck::Exception &e) {
+#ifdef USE_PAM
+			logStream << APPNAME << ": Consolekit::" << e << endl;
+			logStream << APPNAME << ": falling back to PAM session" << endl;
+#else
 			logStream << APPNAME << ": " << e << endl;
 			exit(ERR_EXIT);
+#endif
 		}
 	}
 #endif
@@ -732,7 +737,7 @@
 		char** child_env = pam.getenvlist();
 
 # ifdef USE_CONSOLEKIT
-		if (consolekit_support_enabled)
+		if ( consolekit_support_enabled && ck.get_xdg_session_cookie() )
 		{
 			char** old_env = child_env;
 
@@ -831,7 +836,8 @@
 	if (consolekit_support_enabled)
 	{
 		try {
-			ck.close_session();
+		  	if (ck.get_xdg_session_cookie())
+				ck.close_session();
 		}
 		catch(Ck::Exception &e) {
 			logStream << APPNAME << ": " << e << endl;