[CentOS] umask setting in /etc/profile not working

Wed Jun 11 14:30:00 UTC 2014
zep <zgreenfelder at gmail.com>

On 06/11/2014 10:14 AM, Tim Dunphy wrote:
> Hey all,
>
>  We have the following set in /etc/profile :
>
> umask 0002
>
> so that it will affect all users. That should create all files as 664 and
> all directories as 775 if I'm not mistaken.
>
> Well I logged into the machine after this was set and just created a file
> as one of the users who complained about permissions settings on files. And
> this is what I saw:
>
> [user1 at qa_host ~]$ ls -l test_qa
> -rw-r--r-- 1 user1 domain^users 0 Jun 11 10:08 test_qa
>
> I even tried logging out and logging in again just to be sure. I still got
> the same result.
>
> So my question is why would the file not have the permissions specified by
> the umask command in /etc/profile ? I really need this to work for the
> users.
>
> Any helps or clues would be great!
>
> Thanks
> Tim

depending on your shell; are you sure you're referencing
/etc/profile at all?  e.g. are you using bash or bourne? 
the prompt looks pretty bash like, but assumptions and all.
are you sure there's not another umask entry either
in the user's homedir .file or in something like /etc/bashrc...

I have a fairly recent install of centos 6.5 and get:
[root at critter etc]# grep -i "umask" *
bashrc:    # By default, we want umask to get set. This sets it for
non-login shell.
bashrc:       umask 002
bashrc:       umask 022
bashrc:    umask 077
csh.cshrc:    umask 002
csh.cshrc:    umask 022
login.defs:UMASK           077
php.ini:; does not overwrite the process's umask.
profile:# By default, we want umask to get set. This sets it for login shell
profile:    umask 002
profile:    umask 022

and the php.ini warning is useful to keep in mind; you
can't add back perms with umask, it can only take
away.   so if you start off with reference to /etc/profile
that does umask 022, which then calls /etc/system-settings.profile
that calls umask 077, then get to the users .bashrc
file and try to do umask 002, you'll still be removing all
perms for group and other, the last call won't change anything.