Red Hat Bugzilla – Bug 35714
/etc/profile incorrectly checks for executable bit
Last modified: 2014-03-16 22:20:19 EDT
/etc/profile contains the following lines:
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
The test should be for read (-r) rather than execute (-x), because
source'ing a file reads it.
While you're at it, could you also fix /etc/csh.cshrc to use "-r" for this
That's not a bug, it's just an easy way to turn it off :)
I would respectfully suggest that there are other ways to turn it off without
requiring this broken behaviour (e.g rename to *.sh.x).
It is a bug because it's no guard against the conditional action successfully
reading the file (ditto for csh.cshrc). Being able to execve() a file is not
the same as being able to open() it.
I'm not reporting this to be pedantic; I've seen RPMs packaged by people who
thought that a script file which is sourced needs read permissions; no more.
Will be fixed in 2.4.11-1; thanks!