[Bug 560903] New: Inconsistent path for csh users
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c0 Summary: Inconsistent path for csh users Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: All OS/Version: openSUSE 11.2 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: wjones@fluke.com QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=331093) --> (http://bugzilla.novell.com/attachment.cgi?id=331093) Simple fix, but not necessarily the best. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4) Gecko/20091016 SUSE/3.5.4-6.1 Firefox/3.5.4 The default path for csh users set in /etc/csh.login differs from the bash default path set in /etc/profile. This has been reported before for openSUSE 10.2 and 11.0. See bugs #227416 and #401470. Reproducible: Always Steps to Reproduce: 1. chsh -> /bin/csh 2. login 3. echo $PATH 4. chsh -> /bin/bash 5. login 6. echo $PATH Actual Results: csh and bash paths differ Expected Results: csh and bash paths should be the same. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c shuang qiu <sqiu@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sqiu@novell.com AssignedTo|bnc-team-screening@forge.pr |werner@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c shuang qiu <sqiu@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |werner@novell.com AssignedTo|werner@novell.com |ro@novell.com -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c1 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |wjones@fluke.com Severity|Normal |Enhancement --- Comment #1 from Dr. Werner Fink <werner@novell.com> 2009-12-07 09:33:22 UTC --- Why should this be the same path in all cases? Please report exactly you difference as I do *not* see any difference. It could be that one package influence the path by using different profiles at /etc/profile.d/ ... beside this: does anything not work? As you can see the files /etc/profile and /etc/csh.login uses the same check list for the environment variable PATH ... this is exactly what bug #227416 and bug #401470 are about. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c2 Warren Jones <wjones@fluke.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW CC| |wjones@fluke.com Info Provider|wjones@fluke.com | --- Comment #2 from Warren Jones <wjones@fluke.com> 2009-12-07 17:33:34 UTC --- The logic for setting the path in /etc/profile and /etc/csh.login is identical, except for one detail. /etc/profile begins by explicitly setting the path: PATH=/usr/local/bin:/usr/bin:/bin /etc/csh.login starts with the default path, which is: /usr/bin:/bin:/usr/sbin:/sbin The end result is a different path for csh compare to other shells. Personally, I wish csh would go away; there have been better alternatives for years. But I have to support users who insist on using csh, and if their environment is different, they're going to ask "why does such and such work for this other guy (who uses bash), but it doesn't work for me? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c3 --- Comment #3 from shuang qiu <sqiu@novell.com> 2009-12-08 06:47:09 UTC --- *** Bug 560941 has been marked as a duplicate of this bug. *** http://bugzilla.novell.com/show_bug.cgi?id=560941 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c4 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |wjones@fluke.com --- Comment #4 from Dr. Werner Fink <werner@novell.com> 2009-12-08 09:32:46 UTC --- (In reply to comment #2) Please note that I'm a tcsh user as I prefere tcsh as interactive shell. Beside this IMHO the path scheme should be identical for a most normal user != root the as the initial path in csh.login is /usr/local/bin /usr/bin /bin only for root you'll find the path /sbin /usr/sbin /usr/local/sbin now see /etc/profile if test -z "$PROFILEREAD" ; then PATH=/usr/local/bin:/usr/bin:/bin if test "$HOME" != "/" ; then for dir in $HOME/bin/$CPU $HOME/bin ; do test -d $dir && PATH=$dir:$PATH done fi if test "$UID" = 0 ; then test -d /opt/kde3/sbin && PATH=/opt/kde3/sbin:$PATH PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH fi for dir in /usr/X11/bin \ /usr/bin/X11 \ /usr/X11R6/bin \ /var/lib/dosemu \ /usr/games \ /opt/bin \ /opt/kde3/bin \ /opt/kde2/bin \ /opt/kde/bin \ /usr/openwin/bin \ /opt/cross/bin do test -d $dir && PATH=$PATH:$dir done unset dir export PATH fi and compare this with /etc/csh.login unset noglob set _hpath set _spath set _upath=( /usr/local/bin /usr/bin /bin ) if ( "$HOME" != "/" ) then foreach _d (${HOME}/bin/${CPU} ${HOME}/bin) if ( -d $_d ) set _hpath=( $_d $_hpath ) end endif if ( "$uid" == "0" ) then if ( -d /opt/kde3/sbin ) set _spath=( /opt/kde3/sbin ) set _spath=( /sbin /usr/sbin /usr/local/sbin $_spath ) endif foreach _d (/usr/X11/bin \ /usr/bin/X11 \ /usr/X11R6/bin \ /var/lib/dosemu \ /usr/games \ /opt/bin \ /opt/kde3/bin \ /opt/kde2/bin \ /opt/kde/bin \ /usr/openwin/bin \ /opt/cross/bin ) if ( -d $_d ) set _upath=( $_upath $_d ) end unset _d if ( ${?OPENWINHOME} ) then if ( -d $OPENWINHOME/bin ) then set _upath=( $_upath $OPENWINHOME/bin ) endif endif # # Doing only one rehash # set -f path=( $_hpath $_spath $path $_upath ) unset _upath unset _spath unset _hpath set noglob you may test this by using env -i TERM=$TERM bash -c '. /etc/profile; echo $PATH' env -i TERM=$TERM tcsh -c 'source /etc/csh.login; echo $PATH' which should reflect the paths used in /etc/profile and /etc/csh.login any other path found is caused by the package extension environment files found at /etc/profile.d/ and every package should have both a bourne shell and a csh file. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c5 Warren Jones <wjones@fluke.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|wjones@fluke.com | --- Comment #5 from Warren Jones <wjones@fluke.com> 2009-12-08 20:53:06 UTC --- OK, I see what's going on. The csh and bash paths are indeed the same if you log in from the console. The paths are different if you log in via ssh, which is what I was doing. In /etc/profile, the initial path is set explicitly: PATH=/usr/local/bin:/usr/bin:/bin But no initial path is set in /etc/csh.login, so csh starts with the path it inherits from /bin/login or /usr/sbin/sshd. The path used by login is defined in /etc/login.defs: ENV_PATH /usr/local/bin:/usr/bin:/bin In /etc/ssh/sshd_config we find: # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin Not the same! If you want the same csh path regardless of how you log in (which I think is desirable), then you'll have to set the initial path explicitly in /etc/csh.login, just as it's set in /etc/profile. The patch I suggested is equivalent, but it avoids setting the path twice. Another solution would be to use the path from /etc/login.defs when compiling sshd. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c6 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |anicka@novell.com --- Comment #6 from Dr. Werner Fink <werner@novell.com> 2009-12-09 09:29:27 UTC --- Thank you very much for debugging this fact! Indeed I suppose that sshd should use /usr/local/bin:/usr/bin:/bin for normal users and extend the path with for super user root. Anna? What do you thing about this? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c7 Anna Bernathova <anicka@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anicka@novell.com Info Provider|anicka@novell.com |meissner@novell.com --- Comment #7 from Anna Bernathova <anicka@novell.com> 2009-12-09 13:58:17 UTC --- Well, compiling sshd like we are doing it now is a little more secure: If you compile it, you can be quite sure that only right copies of external binaries (they are used ie. for colection of entropy and some more things) are chosen for using. Adding /usr/local/bin is not likely to do any harm for our builds. But our users could more easily unintentionally rebuild the package with wrong binaries and make their system insecure. I do not know whether it is a problem for us or not, it is a matter of policy. So maybe we should ask what does security team think about it. Marcus? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c8 Marcus Meissner <meissner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW CC| |meissner@novell.com, | |security-team@suse.de Info Provider|meissner@novell.com | --- Comment #8 from Marcus Meissner <meissner@novell.com> 2009-12-09 14:13:42 UTC --- i would leave openssh as-is. (no /usr/local/) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c9 --- Comment #9 from Warren Jones <wjones@fluke.com> 2009-12-10 00:27:37 UTC --- Setting the initial path in /etc/csh.login would be consistent with the way bash startup works. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c10 Ruediger Oertel <ro@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |avalit@web.de --- Comment #10 from Ruediger Oertel <ro@novell.com> 2010-05-18 15:05:12 UTC --- *** Bug 604124 has been marked as a duplicate of this bug. *** http://bugzilla.novell.com/show_bug.cgi?id=604124 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=560903 http://bugzilla.novell.com/show_bug.cgi?id=560903#c11 --- Comment #11 from Andreas Wolfsgruber <avalit@web.de> 2010-05-19 05:11:57 UTC --- (In reply to comment #10)
*** Bug 604124 has been marked as a duplicate of this bug. ***
Sorry, bug 604124 is not a duplicate of bug 560903. The problem in Bug 604124 is: If the environmentvariable $TERM is touched within the startup of a passwordless hostbased authenticated non interactive ssh-session, then the environmentvariable $PATH gets the systems searchpath-environment and not as suggested the searchpath-environment from the users settings in .tcshrc or .cshrc. In SuSE-11.1 the code in /etc/csh.login takes this into consideration using a cascaded if-construct. In SuSE-11.2 the code has changed into one single if-construct. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=560903 https://bugzilla.novell.com/show_bug.cgi?id=560903#c12 Ruediger Oertel <ro@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Basesystem |Basesystem Version|Final |Factory AssignedTo|ro@novell.com |bnc-team-screening@forge.pr | |ovo.novell.com Product|openSUSE 11.2 |openSUSE 11.4 Target Milestone|--- |Factory --- Comment #12 from Ruediger Oertel <ro@novell.com> 2010-11-10 14:57:27 UTC --- werner: this is csh specific ... reassigning let's find something to fix this for factory -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=560903 https://bugzilla.novell.com/show_bug.cgi?id=560903#c Ruediger Oertel <ro@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ro@novell.com AssignedTo|bnc-team-screening@forge.pr |werner@novell.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=560903 https://bugzilla.novell.com/show_bug.cgi?id=560903#c13 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |avalit@web.de --- Comment #13 from Dr. Werner Fink <werner@novell.com> 2010-11-11 11:12:04 UTC --- (In reply to comment #11) About which code you're talking? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=560903 https://bugzilla.novell.com/show_bug.cgi?id=560903#c14 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |RESOLVED InfoProvider|avalit@web.de | Resolution| |FIXED --- Comment #14 from Dr. Werner Fink <werner@novell.com> 2010-11-11 11:23:56 UTC --- IMHO this all is fixed in bash/tcsh ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com