Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 7860

Summary: gdm session startup scripts don't honour user shell
Product: [Retired] Red Hat Linux Reporter: Paul Gear <paul>
Component: gnome-coreAssignee: Havoc Pennington <hp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: mharris, molinero
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-14 17:55:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Paul Gear 1999-12-17 02:27:37 UTC
Most of the session startup scripts in /etc/X11/gdm/Sessions/ have a
hard-coded "#!/bin/bash -login" as their first line.

This means that if the user uses /bin/ksh and hasn't cleaned up the .bash*
files that are supplied in /etc/skel, these files will get executed instead
of their .profile.  (I don't know what happens if tcsh or similar is used,
but i expect it would be even worse.)

I recommend that these scripts be modified to remove the '-login' option to
bash, and have gdm exec the user's login shell manually the way /bin/login
does (by prefixing a '-' to $0), and specify the script to execute on the
command line.  A similar change will likely be required in
/etc/X11/xdm/Xsession.

Comment 1 Havoc Pennington 2000-02-04 22:24:59 UTC
Release 23 of gdm2.0-beta2 has an attempted fix for this, if it doesn't work
for you then please let us know.

Comment 2 Paul Gear 2000-02-25 01:36:59 UTC
No luck.  Here's what i did:
- Use useradd to create a dummy test user (including the default .bash*) files
- Use vipw to change their shell to /bin/ksh
- Add a line to each of the startup files (.bash_profile, .bashrc, .bash_logout,
.kshrc, .profile) which echos the date and the filename to a file, e.g.:
        echo `date`:  .profile >> $HOME/output
- Login as the test user and start a terminal window
- cat output.  The output given is:
Fri Feb 25 11:16:14 EST 2000: .bashrc
Fri Feb 25 11:16:14 EST 2000: .bash_profile
Fri Feb 25 11:16:14 EST 2000: .bashrc

So, even though the user's shell is ksh, their bash startup files get executed
instead of their ksh files, and they get confused!  :-)

Comment 3 Havoc Pennington 2001-07-18 18:34:28 UTC
It turns out that this needs fixing in the Xsession script, rather than in gdm.

Comment 4 Mike A. Harris 2001-07-30 07:28:00 UTC
*** Bug 46475 has been marked as a duplicate of this bug. ***

Comment 5 Mike A. Harris 2001-07-31 07:39:24 UTC
The needed changes were made to Xsession by removing its own -login 
invocation and replacing "exec foo" calls with:

exec -l $SHELL -c foo

Handing this back to Havoc to close if he believes gdm is ready to roll
with this change.

Havoc, also note, any scripts in gnome/kde that rely on this new xinitrc
package should have their dependancies updated to reflect that also.  Good idea
to also comment why the dep is there too as I've learned.  ;o)