Bug#1012474: [PATCH] Xsession does not recognise shell builtins as session-type
Package: x11-common
Version: 1:7.7+23
Severity: normal
Tags: patch
X-Debbugs-Cc: bod@debian.org
A recent change[1] to 20x11-common_process-args causes
"/etc/X11/Xsession true" to pop up an xmessage error, followed by
running the default session.
The default xpra configuration contains such an invocation in order to
run /etc/X11/Xsession.d/* without actually running ~/.xsession.
The reason is that "command -v true" returns "true", which fails the
test for both -e and -x.
Given that "command -v program" already checks if program exists and is
executable, then the test may be simplified to just that invocation.
[1] https://salsa.debian.org/xorg-team/xorg/-/commit/3d6bd60c17ff052fc3f35eb0f17553fcf3d0b23f
-- System Information:
Debian Release: bookworm/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 5.17.0-2-686-pae (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages x11-common depends on:
ii lsb-base 11.2
x11-common recommends no packages.
x11-common suggests no packages.
-- no debconf information
--- 20x11-common_process-args.orig 2021-08-18 20:58:20.000000000 +1000
+++ 20x11-common_process-args 2022-06-08 09:55:01.933452629 +1000
@@ -33,14 +33,8 @@
;;
*)
# Specific program was requested.
- STARTUP_FULL_PATH=$(command -v "${1%% *}" || true)
- if [ -n "$STARTUP_FULL_PATH" ] && [ -e "$STARTUP_FULL_PATH" ]; then
- if [ -x "$STARTUP_FULL_PATH" ]; then
- STARTUP="$1"
- else
- message "unable to launch \"$1\" X session ---" \
- "\"$1\" not executable; falling back to default session."
- fi
+ if command -v "${1%% *}" >/dev/null 2>&1; then
+ STARTUP="$1"
else
message "unable to launch \"$1\" X session ---" \
"\"$1\" not found; falling back to default session."
Reply to: