Bug 608987
Summary: | umask set in /etc/profile.d is eclipsed by bashrc | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Roel Gloudemans <roel> | |
Component: | setup | Assignee: | Ondrej Vasik <ovasik> | |
Status: | CLOSED ERRATA | QA Contact: | qe-baseos-daemons | |
Severity: | medium | Docs Contact: | ||
Priority: | low | |||
Version: | 5.5 | CC: | asersen, azelinka, jmarko, robert | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 661681 (view as bug list) | Environment: | ||
Last Closed: | 2012-02-21 05:39:00 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 661681 |
Description
Roel Gloudemans
2010-06-29 06:25:08 UTC
Not always true ... umask is set in the beginning of /etc/bashrc ... and profile.d scripts are run at the end of /etc/bashrc - unless short option for login shell is provided. That seems to be your case (using su - / su -l / bash -l ... whatever what provides login shell option). Simple bash/su without login shell option will source your umask.sh script and set umask as you want ... Will check why it is done that way... I can confirm this always happens, the execution process is: Login shell 1- /etc/profile is executed sourcing profile.d scripts 2- ~/.bash_profile is executed that calls ~/.bashrc and then /etc/bashrc 3- /etc/bashrc is executed and set umask 4- /etc/bashrc do not calls profile.d because it is inside: if ! shopt -q login_shell No Login shell 1- /etc/profile is not loaded 2- ~/.bashrc is executed and set umask 3- /etc/bashrc calls profile.d because it checks it is not a login shell So profile.d scripts are called before the default umask on /etc/bashrc when it is a login shell and after it when it is not a login shell This make impossible to set a default umask for a login shell without modifying /etc/bashrc Should not be the default umask be at the start of the /etc/profile? why change the umask each time a new no login shell is spawn? I think non login shells must inherit the default umask or any other umask set by the user in .bash_profile without reverting to the default when running /etc/bashrc NOTE: the exact same steps happens on Fedora releases (In reply to comment #3) > > NOTE: the exact same steps happens on Fedora releases True only in released Fedora's ... it is already fixed in rawhide since August - http://koji.fedoraproject.org/koji/buildinfo?buildID=189043 ... probably worth of adding into f14, I don't plan update in older Fedoras. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0198.html |