Red Hat Bugzilla – Bug 617495
/etc/csh.login modified umask after profiled.d scripts are sourced which is inconsistent with bashrc
Last modified: 2012-02-21 00:39:09 EST
Description of problem: A change to the setup rpm added some logic to /etc/csh.login in an attempt to be more consistent with bash login shells. One thing is added was the setting of umask, however unlike /etc/bashrc, the csh.login script is adding the logic at the end of the script after the /etc/profile.d scripts have been sourced. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: The setting of umask in /etc/csh.login happens after the /etc/profile.d scripts are sourced Expected results: The setting of umask in /etc/csh.login should not happen at the end of the script. Additional info: What this does is override any potential changes a sysadmin may have implemented to umask in /etc/profile.d. Prior to RHEL 5.4, you could affect the umask in a csh by adding a script to /etc/profile.d. Now that is not possible.
In fact it is not unlike with bash ... it is now consistent with bash - in bash is umask set in /etc/bashrc - which is sourced after /etc/profile - so it also overrides umask settings from profile.d scripts for login shell (bash -l) ... For consistency reasons it was done the same way in tcsh ( tcsh non-login shell still could be affected by /etc/profile.d/ umask setting scripts). The sequence of tcsh is different from bash - csh.cshrc is sourced first, csh.login second ... Current situation in RHEL-5: bash: umask affected by profile.d .sh scripts bash -l: umask not affected by profile.d .sh scripts tcsh: umask affected by profile.d .csh scripts tcsh -l: umask not affected by profile.d .csh scripts RHEL-5 before the change and RHEL-6 atm: bash: umask affected by profile.d .sh scripts bash -l: umask not affected by profile.d .sh scripts tcsh: umask affected by profile.d .csh scripts tcsh -l: umask affected by profile.d .csh scripts Anyway - it would be better to have even the bash login shell affected by profile.d scripts ... and to revert the change in tcsh ...
> it is now consistent with bash - in bash is umask set in /etc/bashrc - which > is sourced after /etc/profile - so it also overrides umask settings > from profile.d scripts for login shell BUT, on RHEL 5, "umask" is used at the begining of /etc/bashrc, while files from /etc/profile.d are sourced at the end. With bash, on RHEL 5, you can set a particular umask in one of the profile.d script, and it does *NOT* get overwritten by bashrc. Unfortunately this is not the case with csh, which means that if we need a particular mask, we now have to modify /etc/csh.login and /etc/csh.cshrc, which goes right against the concept of using profile.d. This is definitely a bug.
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