Browse Source

Add patch to support runtime detection of consolekit falling back to pam session if not found.

tags/devuan/1.3.6-5.1+devuan5
Mark Hindley 1 year ago
parent
commit
442148b455
2 changed files with 59 additions and 0 deletions
  1. +1
    -0
      debian/patches/series
  2. +58
    -0
      debian/patches/support-consolekit-runtime-detection.patch

+ 1
- 0
debian/patches/series View File

@@ -5,3 +5,4 @@ no-slimlock-with-pam.patch
libslim-cmake-fixes.patch
fix-systemd-service.patch
manpage-formatting-fixes.patch
support-consolekit-runtime-detection.patch

+ 58
- 0
debian/patches/support-consolekit-runtime-detection.patch View File

@@ -0,0 +1,58 @@
--- a/app.cpp
+++ b/app.cpp
@@ -570,8 +570,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
@@ -584,18 +589,20 @@
char** child_env = pam.getenvlist();
# ifdef USE_CONSOLEKIT
- char** old_env = child_env;
+ if (ck.get_xdg_session_cookie()) {
+ char** old_env = child_env;
- /* Grow the copy of the environment for the session cookie */
- int n;
- for(n = 0; child_env[n] != NULL ; n++);
-
- n++;
-
- child_env = static_cast<char**>(malloc(sizeof(char*)*(n+1)));
- memcpy(child_env, old_env, sizeof(char*)*n);
- child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
- child_env[n] = NULL;
+ /* Grow the copy of the environment for the session cookie */
+ int n;
+ for(n = 0; child_env[n] != NULL ; n++);
+
+ n++;
+
+ child_env = static_cast<char**>(malloc(sizeof(char*)*(n+1)));
+ memcpy(child_env, old_env, sizeof(char*)*n);
+ child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
+ child_env[n] = NULL;
+ }
# endif /* USE_CONSOLEKIT */
#else
@@ -663,7 +670,8 @@
#ifdef USE_CONSOLEKIT
try {
- ck.close_session();
+ if (ck.get_xdg_session_cookie())
+ ck.close_session();
}
catch(Ck::Exception &e) {
logStream << APPNAME << ": " << e << endl;

Loading…
Cancel
Save