Bug#653327: x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.
Package: x11-common
Version: 1:7.6+10
Severity: normal
Tags: patch
Dear Maintainer,
I've been trying to get the sawfish WM to work with the latest gnome3.
One the sawfish mailing list I was pointed to how xmonad got things to
work:
https://wiki.archlinux.org/index.php/Xmonad#GNOME_3_and_xmonad
They revolve around starting an Xsession by execing gnome-session with
an argument to point it to a non-standard gnome-session setup for
sawfish.
This approach fails because adding the extra argument breaks a "which"
line in:
/etc/X11/Xsession.d/20x11-common_process-args
The problem is the quoting of the "$1" argument to "which" on line 48:
STARTUP_FULL_PATH=$(/usr/bin/which "$1" || true)
It tells "which" that the "executable" is the entire string:
"gnome-session --session=sawfish"
Removing the quotes:
STARTUP_FULL_PATH=$(/usr/bin/which $1 || true)
allows the session to start up as expected.
Regards,
-Brett.
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 3.1.0-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages x11-common depends on:
ii debconf [debconf-2.0] 1.5.41
ii lsb-base 3.2-28
x11-common recommends no packages.
x11-common suggests no packages.
-- Configuration Files:
/etc/X11/Xsession.d/20x11-common_process-args changed:
OPTIONS=$(cat "$OPTIONFILE") || true
has_option() {
if [ "${OPTIONS#*
$1}" != "$OPTIONS" ]; then
return 0
else
return 1
fi
}
case $# in
0)
# No arguments given; use default behavior.
;;
1)
# One argument given; see what it was.
case "$1" in
failsafe)
# Failsafe session was requested.
if has_option allow-failsafe; then
if [ -e /usr/bin/x-terminal-emulator ]; then
if [ -x /usr/bin/x-terminal-emulator ]; then
exec x-terminal-emulator -geometry +1+1
else
# fatal error
errormsg "unable to launch failsafe X session ---" \
"x-terminal-emulator not executable; aborting."
fi
else
# fatal error
errormsg "unable to launch failsafe X session ---" \
"x-terminal-emulator not found; aborting."
fi
fi
;;
default)
# Default behavior was requested.
;;
*)
# Specific program was requested.
STARTUP_FULL_PATH=$(/usr/bin/which $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
else
message "unable to launch \"$1\" X session ---" \
"\"$1\" not found; falling back to default session."
fi
;;
esac
;;
*)
# More than one argument given; we don't know what to do.
message "unsupported number of arguments ($#); falling back to default" \
"session."
;;
esac
-- debconf information excluded
Reply to: