Package: gdm3
Version: 3.38.0-2
Severity: important
Tags: patch

Changes in x11-common for #920778
(https://salsa.debian.org/xorg-team/xorg/-/merge_requests/5) moved
has_option function from Xsession.d/20x11-common_process-args to
Xsession, and now the Xsession.d files that depend on it fail to load.
For example, 30x11-common_xresources fails to load ~/.Xresources.

Adding the implementation of this function from /etc/X11/Xsession to
/etc/gdm3/Xsession before the Xsession.d files are sourced fixed the
problem. Patch attached.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-3-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gdm3 depends on:
ii  accountsservice                       0.6.55-3
ii  adduser                               3.118
ii  dbus                                  1.12.20-1
ii  dconf-cli                             0.38.0-1
ii  dconf-gsettings-backend               0.38.0-1
ii  debconf [debconf-2.0]                 1.5.74
ii  gir1.2-gdm-1.0                        3.38.0-2
ii  gnome-session [x-session-manager]     3.38.0-2
ii  gnome-session-bin                     3.38.0-2
ii  gnome-session-common                  3.38.0-2
ii  gnome-settings-daemon                 3.38.0-2
ii  gnome-shell                           3.38.1-1
ii  gnome-terminal [x-terminal-emulator]  3.38.0-1
ii  gsettings-desktop-schemas             3.38.0-2
ii  libaccountsservice0                   0.6.55-3
ii  libaudit1                             1:2.8.5-3+b1
ii  libc6                                 2.31-4
ii  libcanberra-gtk3-0                    0.30-7
ii  libcanberra0                          0.30-7
ii  libgdk-pixbuf2.0-0                    2.40.0+dfsg-5
ii  libgdm1                               3.38.0-2
ii  libglib2.0-0                          2.66.1-1
ii  libglib2.0-bin                        2.66.1-1
ii  libgtk-3-0                            3.24.23-2
ii  libkeyutils1                          1.6.1-2
ii  libpam-modules                        1.3.1-5
ii  libpam-runtime                        1.3.1-5
ii  libpam-systemd                        246.6-1
ii  libpam0g                              1.3.1-5
ii  librsvg2-common                       2.50.1+dfsg-1
ii  libselinux1                           3.1-2
ii  libsystemd0                           246.6-1
ii  libx11-6                              2:1.6.12-1
ii  libxau6                               1:1.0.8-1+b2
ii  libxcb1                               1.14-2
ii  libxdmcp6                             1:1.1.2-3
ii  lsb-base                              11.1.0
ii  mutter [x-window-manager]             3.38.1-1
ii  policykit-1                           0.105-29
ii  procps                                2:3.3.16-5
ii  ucf                                   3.0043
ii  x11-common                            1:7.7+21
ii  x11-xserver-utils                     7.7+8
ii  xterm [x-terminal-emulator]           360-1

Versions of packages gdm3 recommends:
ii  at-spi2-core    2.38.0-2
ii  desktop-base    10.0.3
ii  x11-xkb-utils   7.7+5
ii  xserver-xephyr  2:1.20.9-2
ii  xserver-xorg    1:7.7+21
ii  zenity          3.32.0-6

Versions of packages gdm3 suggests:
pn  gnome-orca            <none>
pn  libpam-fprintd        <none>
ii  libpam-gnome-keyring  3.36.0-1

-- Configuration Files:
/etc/gdm3/Xsession changed [not included]

-- debconf information:
* shared/default-x-display-manager: gdm3
  gdm3/daemon_name: /usr/sbin/gdm3
>From 498f2570edaa193256b21378ef551b28a301ea4d Mon Sep 17 00:00:00 2001
From: Dmitry Borodaenko <angdr...@debian.org>
Date: Mon, 12 Oct 2020 11:11:26 -0700
Subject: [PATCH] Implement has_option in Xsession

Now that x11-common moved this function from 20x11-common_process-args
to Xsession (see #920778), gdm's version of Xsession also has to
implement it.
---
 debian/Xsession | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/debian/Xsession b/debian/Xsession
index 30132ef1..a10f106f 100644
--- a/debian/Xsession
+++ b/debian/Xsession
@@ -177,6 +177,24 @@ if [ "x$command" = "xcustom" ] ; then
   set default $*
 fi
 
+OPTIONS="$(
+  if [ -r "$OPTIONFILE" ]; then
+    cat "$OPTIONFILE"
+  fi
+  if [ -d /etc/X11/Xsession.options.d ]; then
+    run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d
+  fi
+)"
+
+has_option() {
+  # Ensure that a later no-foo overrides an earlier foo
+  if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
 # use run-parts to source every file in the session directory; we source
 # instead of executing so that the variables and functions defined above
 # are available to the scripts, and so that they can pass variables to each
-- 
2.28.0

Reply via email to