Bug#653327: marked as done (x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.)
Your message dated Wed, 8 Jun 2022 09:24:53 +1000
with message-id <Yp/eRQnY+qNLElZq@c47.org>
and subject line Re: Bug#653327: x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.
has caused the Debian Bug report #653327,
regarding x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)
--
653327: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653327
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.
- From: Brett Viren <brett.viren@gmail.com>
- Date: Mon, 26 Dec 2011 18:06:30 -0500
- Message-id: <20111226230630.13833.89986.reportbug@hal.local>
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
--- End Message ---
--- Begin Message ---
- To: Michael Biebl <biebl@debian.org>, 653327-close@bugs.debian.org
- Subject: Re: Bug#653327: x11-common: Quoting in 20x11-common_process-args breaks starting gnome-session with arguments.
- From: Brendan O'Dea <bod@debian.org>
- Date: Wed, 8 Jun 2022 09:24:53 +1000
- Message-id: <Yp/eRQnY+qNLElZq@c47.org>
- In-reply-to: <52586611.6070901@debian.org>
- References: <52582C68.90507@debian.org> <52586611.6070901@debian.org>
On Fri, Oct 11, 2013 at 10:56:49PM +0200, Michael Biebl wrote:
>/etc/X11/Xsession.d/20x11-common_process-args fails to process that
>additional command line arguments, specifically
>STARTUP_FULL_PATH=$(/usr/bin/which "$1" || true)
>
>"$1" contains "gnome-session --session classic", so "which" fails and
>doesn't return /usr/bin/gnome-session. One needs to strip the additional
>parameter, which the expression "${1%% *}" does.
>
>Patch is from Didier Roche, see attachment.
[...]
>Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/512235
>Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653327
>---
> debian/local/Xsession.d/20x11-common_process-args | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/debian/local/Xsession.d/20x11-common_process-args b/debian/local/Xsession.d/20x11-common_process-args
>index 93e4653..149d1d2 100644
>--- a/debian/local/Xsession.d/20x11-common_process-args
>+++ b/debian/local/Xsession.d/20x11-common_process-args
>@@ -45,7 +45,7 @@ case $# in
> ;;
> *)
> # Specific program was requested.
>- STARTUP_FULL_PATH=$(/usr/bin/which "$1" || true)
>+ 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"
>--
>1.8.4.rc3
>
This patch appears to have been applied a while ago:
https://salsa.debian.org/xorg-team/xorg/-/commit/4e760f217643d8419d4d24a3ebb2b61ac74cf990
--bod
--- End Message ---
Reply to: