[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with UMASK and file/directory permissions on sarge



"intendedacceleration" <intendedacceleration@gmail.com> writes:

> Well, no since I have the guid bit set, it creates the folders/files
> with the correct group assigned right now (done with a 2774 on the main
> directory). Now I just need to get the permissions functioning
> correctly.

OK, sorry for just understanding gradually what your problem is.

So, /etc/profile actually works and sets an umask of 002, right?
Now you have a 2774 dir and want the right perms on newly subdirs
and files, where subdirs work and files not, right?

So, I'll try to reproduce that under my user bhertz

 $ cd /tmp; mkdir abc
 $ ls -dl abc
 drwxr-xr-x  2 bhertz bhertz 4096 2005-04-04 21:13 abc

 $ su -c "chown bhertz:news abc"
 $ ls -dl abc
 drwxr-xr-x  2 bhertz news 4096 2005-04-04 21:13 abc

 $ su -c "chmod 2774 abc" # su because I'm not actually member of news
 $ ls -dl abc
 drwxrwsr--  2 bhertz news 4096 2005-04-04 21:13 abc

So, 'sticky' bit is set on group. Now my currently active umask

 $ umask
 0022

Now let's see

 $ cd abc
 $ touch a
 $ mkdir b
 $ ls -l
 -rw-r--r--  1 bhertz news    0 2005-04-04 21:19 a
 drwxr-sr-x  2 bhertz news 4096 2005-04-04 21:19 b

Looks good. Now different umask

 $ umask 002
 $ touch c
 $ mkdir d
 $ ls -l
 -rw-r--r--  1 bhertz news    0 2005-04-04 21:19 a
 drwxr-sr-x  2 bhertz news 4096 2005-04-04 21:19 b
 -rw-rw-r--  1 bhertz news    0 2005-04-04 21:20 c
 drwxrwsr-x  2 bhertz news 4096 2005-04-04 21:20 d

Well, everything's fine. When umask is set properly, either by hand or profile,
the write bit is set on both files and directories. So where exactly does it fail
with you?

Regards, Bruno.



Reply to: