Bug 7860 - gdm session startup scripts don't honour user shell
gdm session startup scripts don't honour user shell
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gnome-core (Show other bugs)
6.1
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Havoc Pennington
:
: 46475 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-16 21:27 EST by Paul Gear
Modified: 2007-03-26 23:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-04-14 13:55:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paul Gear 1999-12-16 21:27:37 EST
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 17:24:59 EST
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-24 20:36:59 EST
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 14:34:28 EDT
It turns out that this needs fixing in the Xsession script, rather than in gdm.
Comment 4 Mike A. Harris 2001-07-30 03:28:00 EDT
*** Bug 46475 has been marked as a duplicate of this bug. ***
Comment 5 Mike A. Harris 2001-07-31 03:39:24 EDT
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)

Note You need to log in before you can comment on or make changes to this bug.