did this lead to the solution?
Currently I can't think of way to do this. Nevertheless, read on :)
/folder (umask 002)
/folder/subfolder (umask 022)
in a clean and proper way.
One could create a script, that detects new subfolders and then goes setting
the umask to 022 - but that's not really what I call clean.
Wait a sec, how about this:
Maybe there's another proper way of achiving:
/folder (umask 002) | every user can create new directories
/folder/subfolder (still umask 002) | every user can read, but not write in
the subfolder created by another user.
As long as you don't set the sticky bit for users and groups on the directory
(chmod -R 6774 /folder), a new directory created will have the ownership:
and as long as other users aren't member of 'userAsdefaultgroup', they won't
be able to write to /folder/subfolder - even if the umask is 002.
I gues this quite depends on the system you use.
Most of the systems I see do this:
When a user is created, there's also a group created coresponding to that user
and this group becomes the users default group.
Some others I saw do this:
In this second case, no coresponding group is created - but the user gets
added to group 'users' upon creation, making 'users' the default group for
I hope this gives you the inspiration to solve this problem.