Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57403 - kde 3.3.0_beta1 Xsession bash-specific init code invoked when bash is in sh compatibility mode
Summary: kde 3.3.0_beta1 Xsession bash-specific init code invoked when bash is in sh c...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-17 11:01 UTC by Denys Duchier
Modified: 2004-08-16 16:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denys Duchier 2004-07-17 11:01:50 UTC
The Xsession script for KDE 3.3.0_beta1 has some clever code that attempts
to appropriately source the user's shell init files.  That code doesn't
work for me because Xsession is invoked as a regular /bin/sh script, and
sh happens to be bash.  So we have SHELL=/bin/bash BASH=/bin/sh and bash
is basically operating in sh compatibility mode where not all bash extensions
are supported.  This leads to errors when the bash specific init files are
loaded.  For example, I have bash code like:

function foo--bar() { ... }

and, in sh compat-mode, I get complaints about foo--bar being an invalid
identifier.

I fixed it by changing /bin/sh to /bin/bash in Xsession, but, I guess,
whereever Xsession is actually invoked, it should be invoked as $SHELL Xsession
where $SHELL is the user's shell.

I'd say it is a fairly severe issue because it causes users to not be able to
log in; and that's about as broken as it can get from a user's perspective ;-)

Reproducible: Always
Steps to Reproduce:




Portage 2.0.50-r9 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 
2.4.26-gentoo-r5) 
================================================================= 
System uname: 2.4.26-gentoo-r5 i686 Intel(R) Pentium(R) III Mobile CPU      
1200MHz 
Gentoo Base System version 1.4.16 
Autoconf: sys-devel/autoconf-2.59-r3 
Automake: sys-devel/automake-1.8.3 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache sandbox" 
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ 
ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo/ 
http://gentoo.oregonstate.edu/ 
http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
MAKEOPTS="-j1" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="/project/ARCH/Projects/portage/configs/=build" 
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" 
USE="X aalib alsa apm arts avi berkdb bonobo crypt cups dvd encode esd 
foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde ldap 
libg++ libwww mad mikmod motif mozilla mozsvg mpeg mysql ncurses nls oggvorbis 
opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell sse 
ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"
Comment 1 Gregorio Guidi (RETIRED) gentoo-dev 2004-07-18 03:43:32 UTC
Perhaps a proper fix (to send upstream) would be substituting

[ -z "$BASH" ] && exec $SHELL $0 "$@"

with

[ "$BASH" = "$SHELL" ] || exec $SHELL $0 "$@"

(and for other shells, too)
in Xsession (in kdebase/kdm/kfrontend/genkdmconf.c)
Comment 2 Gregorio Guidi (RETIRED) gentoo-dev 2004-07-21 16:05:10 UTC
Yesterday I was bored, so I reported this bug upstream:
http://bugs.kde.org/show_bug.cgi?id=85544
Comment 4 Carsten Lohrke (RETIRED) gentoo-dev 2004-08-16 16:59:16 UTC
I like it when you're bored Gregorio. ;)