LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   a specific umask for a folder (https://www.linuxquestions.org/questions/linux-security-4/a-specific-umask-for-a-folder-692626/)

nass 12-23-2008 08:19 PM

a specific umask for a folder
 
hello everyone,
i know my question has been raised in internet forums on occasions..., but i have failed to receive an answer

im looking for a way to set the umask for a specific directory to a different value (0002), than the global one (0022)...

obviously this is a shared folder and i have set the gid bit so that all file in the directory belong to a specific group... chmod will give the permissions that i wish for... but all new files will be generated according the default umask...
how can i set a umask specific to the directory?

TIA
nass

kenneho 12-24-2008 01:54 AM

Hi.

I'm not sure if this will solve your problem, but have you considered using ACLs? You can set a default ACL for a folder, so that all folders and files created under this folder will inherit the ACL. I'm think that ACLs override "regular" linux file attributes, so hopefully this will solve your problem.

Regards,
kenneho

archtoad6 12-24-2008 05:20 PM

OP, are you still using Slackware 11?

Does it have ACL's?

Do you know anything about using them?

If all you want is for files & directories to inherit ownership & permissions from the parent "folder", I believe you can do it w/ GID bits on the parent. RT:)M chmod & chown for the details. Post back if you don't understand the man page(s).

nass 12-24-2008 06:56 PM

i don't think this is the case with the s bit in gid...
it is there to preserve group ownership for dirs and files within an s-bit GID directory, but it does not alter the group permissions of a dir or file that will be created afterwards.. this is still governed by the umask....

and i want a specific -different- umask for a certain common directory...

i think ACLs will do the trick..
they should be pretty easy to handle since they are a superset of the POSIX file attributes.

im looking into them right now

kenneho 12-29-2008 04:00 AM

Quote:

Originally Posted by nass (Post 3386533)
i think ACLs will do the trick..
they should be pretty easy to handle since they are a superset of the POSIX file attributes.

im looking into them right now

Cool. Please post back the result.

kribor 11-01-2011 09:14 AM

You can specify a umask when using "mount bind", let me know if you need more info

kribor 11-01-2011 04:44 PM

I have now written a blog post on the subject...

http://www.linuxquestions.org/questi...-bindfs-23934/

silentquasar 01-13-2014 11:08 PM

How to solve with ACLs
 
Resurrecting an old thread, but I find the answer that worked for my situtation. I basically followed this blog post: http://brunogirin.blogspot.com/2010/...th-setgid.html

-Randy


All times are GMT -5. The time now is 06:39 AM.