conf/186085: Default shell config files in /usr/share/skel/ override path set by login.conf/login.conf.db

Glen Neff glen.neff at emc.com
Fri Jan 24 21:00:00 UTC 2014


>Number:         186085
>Category:       conf
>Synopsis:       Default shell config files in /usr/share/skel/ override path set by login.conf/login.conf.db
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 24 21:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Glen Neff
>Release:        9.2-RELEASE
>Organization:
EMC
>Environment:
FreeBSD gneffpc.nas-v6.rtp.lab.emc.com 9.2-RELEASE FreeBSD 9.2-RELEASE #0: Tue Dec 17 12:21:08 EST 2013     root at gneffpc.nas-v6.rtp.lab.emc.com:/usr/obj/usr/src/sys/gneffpc  amd64
>Description:
/etc/login.conf is a "flat-file" that defines, amongst other things, the default path for the system.  cap_mkdb(1) is used to write a hashed database of these settings to /etc/login.conf.db.

The problem, however, is that this default system path is overridden by the default per-user shell config files in /usr/share/skel/, specifically the dot.cshrc (which affects csh & tcsh) & dot.profile (which affects sh & bash).

This becomes a problem when you attempt to change the system path via /etc/login.conf & cap_mkdb(1) and your changes are nullified by the .cshrc and/or .profile files in users's home directories copied from /usr/share/skel/.
>How-To-Repeat:
Add/remove directories from the path in /etc/login.conf, run 'cap_mkdb /etc/login.conf', then login as a user with .cshrc and/or .profile files copied from /usr/share/skel/dot.cshrc & /usr/share/skel/dot.profile.
>Fix:
Remove path settings from the following files in /usr/share/skel/:

dot.cshrc
dot.profile

Patch attached with submission follows:

diff -ruN share/skel.old/dot.cshrc share/skel/dot.cshrc
--- share/skel.old/dot.cshrc	2013-09-26 21:03:29.000000000 -0400
+++ share/skel/dot.cshrc	2014-01-24 15:48:17.000000000 -0500
@@ -15,8 +15,6 @@
 # A righteous umask
 umask 22
 
-set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
-
 setenv	EDITOR	vi
 setenv	PAGER	more
 setenv	BLOCKSIZE	K
diff -ruN share/skel.old/dot.profile share/skel/dot.profile
--- share/skel.old/dot.profile	2013-09-26 21:03:29.000000000 -0400
+++ share/skel/dot.profile	2014-01-24 15:48:31.000000000 -0500
@@ -5,9 +5,6 @@
 # see also sh(1), environ(7).
 #
 
-# remove /usr/games if you want
-PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH
-
 # Setting TERM is normally done through /etc/ttys.  Do only override
 # if you're sure that you'll never log in via telnet or xterm or a
 # serial line.


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list