Bug#266814: kdm: Xsession script is not robust with tcsh
Package: kdm
Version: 4:3.3.0-1
Severity: important
When a user has tcsh/csh a login shell there are problems with the
current version of the /etc/kde3/kdm/Xsession script.
The problem is the command:
eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c set | egrep -v "^(BASH_VERSINFO|EUID|PPID|UID|_)="'`
When executing this after updating my unstable installation, it became
impossible for me to log in. The session would abort immediately,
because the above command would abort the Xsession script with an
error.
The error is triggered by the variables GROUPS and DIRSTACK (with
appears as "()") and SHELLOPTS which is a readonly variable, as
witnessed by the following list of values as they would appear for me:
ABCDE_TOP=/vobs/ABCDE/ABCDE_LXA119334
BASH=/bin/sh
BASH_EXECUTION_STRING=set
BASH_VERSION='3.00.0(1)-release'
CLEARCASE_AVOBS=/vobs/isac/sis
COLUMNS=79
CVSREMOTE=situla.ted.dk.eu.ericsson.se
CVS_RSH=ssh
DESKTOP_SESSION=custom
DIRSTACK=()
DISPLAY=:0
DM_CONTROL=/var/run/xdmctl
EDITCMD='emacs21 -i '
EDITOR=emacsclient
EFONT=
EGEO=
EMACS='21.3.1 (term:0.95)'
ENAME=
EOPT=-i
EPRG='emacs21 -i '
GROUP=LMD-Telebit
GROUPS=()
HOME=/home/tedchly
HOMEHOST=situla.ted.dk.eu.ericsson.se
HOST=situla.ted.dk.eu.ericsson.se
HOSTNAME=situla.ted.dk.eu.ericsson.se
HOSTTYPE=i386-linux
IFS='
'
JAVA_HOME=/usr/java/./jdk1.5.0
LESS=mqe
LESSCHARSET=latin1
LINES=34
LOCALDISPLAY=yes
LOGNAME=tedchly
MACHTYPE=i386
MAILCAPS=/home/tedchly/.mailcap
MARKED=/home/tedchly
OPTERR=1
OPTIND=1
OSTYPE=linux
PAGER=/usr/bin/less
PATH=/home/tedchly/Sys/bin:/home/tedchly/Sys/i686-pc-linux-gnu/bin:/home/tedchly/Public/eclipse/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/atria/bin:/opt/rational/clearcase/bin
POSIXLY_CORRECT=y
PREFIX=/home/tedchly/Sys/i686-pc-linux-gnu
PRVHOST=situla.ted.dk.eu.ericsson.se
PS4='+ '
PWD=/home/tedchly
RMTSTYLE=:pserver:situla.ted.dk.eu.ericsson.se@
SHELL=/usr/bin/tcsh
SHELLOPTS=braceexpand:hashall:interactive-comments:posix
SHLVL=8
SSH_AGENT_PID=3924
SSH_ASKPASS=/usr/bin/ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-RylmMQ3923/agent.3923
SYSARCH=i686-pc-linux-gnu
SYSCLASS=main
SYSTYPE=lignux
TERM=eterm
TEXMF='{/usr/share/texmf,/home/tedchly/Sys/texmf}'
TMPDIR=/tmp
USER=tedchly
VENDOR=intel
VISUAL=emacsclient
WINEDITOR=emacsclient
XDISP_MM=433x347
XDISP_PIXELS=1280x1024
XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,method=classic
XSHELL=xterm
ftp_proxy=http://www-proxy.ericsson.se:8080/
gopher_proxy=http://www-proxy.ericsson.se:8080/
http_proxy=http://www-proxy.ericsson.se:8080/
no_proxy=.ericsson.se,.softlab.se,.erisoft.se
session=3970
wais_proxy=http://www-proxy.ericsson.se:8080/
If one adds these three variables to the list of values filtered out,
such that the eval command now looks like this:
eval `$SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c set | egrep -v "^(BASH_VERSINFO|EUID|PPID|UID|_|GROUPS|DIRSTACK|SHELLOPTS)="'`
the problem disappears.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.24-ted
Locale: LANG=C, LC_CTYPE=C
Versions of packages kdm depends on:
ii debconf 1.4.31 Debian configuration management sy
ii kdebase-bin 4:3.3.0-1 KDE Base (binaries)
ii kdelibs4 4:3.3.0-1 KDE core libraries
ii libart-2.0-2 2.3.16-6 Library of functions for 2D graphi
ii libc6 2.3.2.ds1-16 GNU C Library: Shared libraries an
ii libfam0c102 2.7.0-5 client library to control the FAM
ii libgcc1 1:3.4.1-5 GCC support library
ii libice6 4.3.0.dfsg.1-6 Inter-Client Exchange library
ii libidn11 0.5.2-2 GNU libidn library, implementation
ii libpam-runtime 0.76-22 Runtime support for the PAM librar
ii libpam0g 0.76-22 Pluggable Authentication Modules l
ii libpng12-0 1.2.5.0-7 PNG library - runtime
ii libqt3c102-mt 3:3.3.3-3 Qt GUI Library (Threaded runtime v
ii libsm6 4.3.0.dfsg.1-6 X Window System Session Management
ii libstdc++5 1:3.3.4-9 The GNU Standard C++ Library v3
ii libx11-6 4.3.0.dfsg.1-6 X Window System protocol client li
ii libxext6 4.3.0.dfsg.1-6 X Window System miscellaneous exte
ii libxrender1 0.8.3-7 X Rendering Extension client libra
ii libxtst6 4.3.0.dfsg.1-6 X Window System event recording an
ii xbase-clients 4.3.0.dfsg.1-6 miscellaneous X clients
ii xlibs 4.3.0.dfsg.1-6 X Window System client libraries m
ii zlib1g 1:1.2.1.1-5 compression library - runtime
-- debconf information:
kdm/stop_running_server_with_children: false
* shared/default-x-display-manager: kdm
kdm/daemon_name: /usr/bin/kdm
ii tcsh 6.13.01-4 TENEX C Shell, an enhanced version of Berkel
------------------------+-----------------------------------------------------
Christian Lynbech | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
- petonic@hal.com (Michael A. Petonic)
Reply to: