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;
