[Pkg-ltsp-devel] Bug#499995: ldm: when user selects session, /etc/X11/Xsession isn't used

Vagrant Cascadian vagrant+debianbugs at freegeek.org
Wed Sep 24 07:00:51 UTC 2008


Package: ldm
Version: 2:2.0.6-2
Severity: important
Tags: patch

when logging in using ldm, if a user selects a session from the
preferences menu, ldm does not use /etc/X11/Xsession (it calls the
session/window manager binary directly), and then all the hooks in
/etc/X11/Xsession.d are not called, resulting in a session that isn't
consistant with the default session.

attached is a patch to fix this, backported from upstream bzr.

live well,
  vagrant

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## xsession-with-selected-session-lenny.dpatch by Vagrant Cascadian <vagrant at freegeek.org>
##
## All lines beginning with `## DP:' are a description of the patch.

## DP: use /etc/X11/Xsession when user selects session from menu, instead of
## DP: calling the selected session directly. backported from upstream for
## DP: lenny.

@DPATCH@
diff -urNad ldm-2.0.6~/src/ldm.c ldm-2.0.6/src/ldm.c
--- ldm-2.0.6~/src/ldm.c	2008-09-23 23:25:40.000000000 -0700
+++ ldm-2.0.6/src/ldm.c	2008-09-23 23:32:51.000000000 -0700
@@ -303,7 +303,13 @@
         }
     }
             
-    cmd[i++] = ldminfo.session;
+    cmd[i++] = ldminfo.xsession;
+    if (*ldminfo.session == '\0') {
+            cmd[i++] = "default";
+        } else {
+            cmd[i++] = ldminfo.session;
+        }
+
 
     if (ldminfo.localdev) {
         cmd[i++] = ";";        /* closes bug number 121254 */
@@ -453,22 +459,23 @@
     ldminfo.force_logout = ldm_getenv_bool("LDM_FORCE_LOGOUT");
     scopy(ldminfo.lang, getenv("LDM_LANGUAGE"));
     scopy(ldminfo.session, getenv("LDM_SESSION"));
-    if (*ldminfo.session == '\0') {
+    scopy(ldminfo.xsession, getenv("LDM_XSESSION"));
+    if (*ldminfo.xsession == '\0') {
         if(!access("/etc/X11/xinit/Xsession", X_OK)) {
             /* Fedora, RHEL, CentOS, etc. */
-            scopy(ldminfo.session, "/etc/X11/xinit/Xsession");
+            scopy(ldminfo.xsession, "/etc/X11/xinit/Xsession");
         }
         else if(!access("/etc/X11/Xsession", X_OK)) {
             /* Debian, Ubuntu */
-            scopy(ldminfo.session, "/etc/X11/Xsession");
+            scopy(ldminfo.xsession, "/etc/X11/Xsession");
         }
         else if(!access("/usr/lib/X11/xdm/Xsession", X_OK)) {
             /* Gentoo */
-            scopy(ldminfo.session, "/usr/lib/X11/xdm/Xsession");
+            scopy(ldminfo.xsession, "/usr/lib/X11/xdm/Xsession");
         }
         else if(!access("/etc/X11/xdm/Xsession", X_OK)) {
             /* OpenSUSE */
-            scopy(ldminfo.session, "/etc/X11/xdm/Xsession");
+            scopy(ldminfo.xsession, "/etc/X11/xdm/Xsession");
         }
     }
     scopy(ldminfo.greeter_prog, getenv("LDM_GREETER"));
diff -urNad ldm-2.0.6~/src/ldm.h ldm-2.0.6/src/ldm.h
--- ldm-2.0.6~/src/ldm.h	2008-09-23 23:25:40.000000000 -0700
+++ ldm-2.0.6/src/ldm.h	2008-09-23 23:33:16.000000000 -0700
@@ -12,6 +12,7 @@
     char    password[LDMSTRSZ];
     char    lang[LDMSTRSZ];
     char    session[LDMSTRSZ];
+    char    xsession[LDMSTRSZ];
     char    sound_daemon[LDMSTRSZ];
     char    greeter_prog[LDMSTRSZ];
     char    control_socket[LDMSTRSZ];


More information about the Pkg-ltsp-devel mailing list