pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kdm Xsession doesn't login non-kde session with csh/tcsh - like pkg/40165 and pkg/37158

The following reply was made to PR pkg/40165; it has been noted by GNATS.

Subject: kdm Xsession doesn't login non-kde session with csh/tcsh - like 
pkg/40165 and pkg/37158
Date: Mon,  2 Feb 2009 21:48:38 +0000 (UTC)

 >Submitter-Id: net
 >Originator:   Chuck Zmudzinski
 >Organization: Fathers of Mercy
 >Confidential: no
 >Synopsis:     kdm Xsession doesn't login non-kde session with csh/tcsh - like 
 >pkg/40165 and pkg/37158
 >Severity:     non-critical
 >Priority:     low
 >Category:     pkg
 >Class:                sw-bug
 >Release:      4.0_Stable
 >Environment:  NetBSD ave 4.0_STABLE NetBSD 4.0_STABLE (GENERIC.NOACPI) #0: 
 >Tue Jan 13 14:22:25 CST 2009  
 >chuckz@ave:/usr/src/sys/arch/i386/compile/GENERIC.NOACPI i386
 On NetBSD-4/i386 and pkgsrc-2008Q4 (kdebase-3.5.10nb1), the default Xsession 
file for kdm created by genkdmconf wipes out the environment when csh is the 
logging on user's shell, including critical variables like HOME and PATH. This 
breaks the ability of kdm to start the non-kde sessions such as custom and 
failsafe for users using csh as their default shell. pkg/40165 also reports 
problems with environment variables not found, but the reporter of that bug 
didn't say if he was using csh.
 The problem is caused by the fact that the Xsession script apparently fails to 
pick up the -p flag to '/bin/sh export' in the commands that are run by 
kdm/Xsession in the case that csh or tcsh is the user's shell. Without the -p 
flag, I noticed that NetBSD's '/bin/sh export' command only exports a list of 
the environment variable names, without their values. This is not the case on 
other systems, such as OpenSuse 10, where '/bin/sh export' does not need the -p 
flag to export both the environment variables and their values. This is 
probably why the developers of kde/kdm have not noticed this problem that is 
probably specific to NetBSD, and possibly other systems, but not to Linux. 
pkg/37158 is the same problem but apparently before the -p option was added to 
sh export, and it solved the  problem by replacing sh export with env.
 1. Install kdebase-3.5.10nb1.tgz
 2. change shell to /bin/csh
 3. configure system to use kdm, and make sure kdm uses default Xsession file 
from genkdmconfig
 4. On kdm login screen, choose a non-kde session type (failsafe or twm will 
showed this problem for me)
 5. The login will fail and return to the kdm login screen
 Surround export -p in single quotes in usr/pkg/share/kde/config/kdm/Xsession 
to ensure /bin/sh will apply the -p flag to its export command.
 Here is a patch that solved the problem on my NetBSD-4 system:
 --- usr/pkg/share/kde/config/kdm/Xsession.orig       2009-01-13 
04:00:42.000000000 -0600
 +++ usr/pkg/share/kde/config/kdm/Xsession    2009-01-31 21:33:52.000000000 
 @@ -32,7 +32,7 @@
      # [t]cshrc is always sourced automatically.
      # Note that sourcing csh.login after .cshrc is non-standard.
      xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
 -    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) 
source ~/.login; /bin/sh -c export -p >! $xsess_tmp"
 +    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) 
source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp"
      . $xsess_tmp
      rm -f $xsess_tmp
 Here is a patch to consider adding to pkgsrc/x11/kdebase3/patches, or 
forwarding up to kde for their consideration:
 --- kdm/kfrontend/genkdmconf.c.orig    2008-02-13 03:40:49.000000000 -0600
 +++ kdm/kfrontend/genkdmconf.c 2009-02-01 21:49:33.000000000 -0600
 @@ -673,7 +673,7 @@
  "    xsess_tmp=";
  static const char def_session2[] =
 -"    $SHELL -c \"if (-f /etc/csh.login) source /etc/csh.login; if (-f 
~/.login) source ~/.login; /bin/sh -c export -p >! $xsess_tmp\"\n"
 +"    $SHELL -c \"if (-f /etc/csh.login) source /etc/csh.login; if (-f 
~/.login) source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp\"\n"
  "    . $xsess_tmp\n"
  "    rm -f $xsess_tmp\n"
  "    ;;\n"

Home | Main Index | Thread Index | Old Index