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

Wed Jun 11 15:13:35 UTC 2014
Leon Fauster <leonfauster at googlemail.com>

Am 11.06.2014 um 16:14 schrieb Tim Dunphy <bluethundr at gmail.com>:
> 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!




Tim, briefly, don't do that. This (mentioned umask in profile) 
should be classified as bad practice. What is your primarily 
goal? What is the users scenario?  

Take a look into ACL (rpm package acl):

$ man setfacl
$ man getfacl 

There exist a "default" setting to inherit such settings (e.g. write operations for groups).

--
LF