LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-23-2008, 08:19 PM   #1
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Rep: Reputation: 39
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
 
Old 12-24-2008, 01:54 AM   #2
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
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
 
Old 12-24-2008, 05:20 PM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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. RTM chmod & chown for the details. Post back if you don't understand the man page(s).
 
Old 12-24-2008, 06:56 PM   #4
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Original Poster
Rep: Reputation: 39
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
 
Old 12-29-2008, 04:00 AM   #5
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
Quote:
Originally Posted by nass View Post
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.
 
Old 11-01-2011, 09:14 AM   #6
kribor
LQ Newbie
 
Registered: Nov 2011
Posts: 2
Blog Entries: 1

Rep: Reputation: Disabled
You can specify a umask when using "mount bind", let me know if you need more info
 
Old 11-01-2011, 04:44 PM   #7
kribor
LQ Newbie
 
Registered: Nov 2011
Posts: 2
Blog Entries: 1

Rep: Reputation: Disabled
I have now written a blog post on the subject...

http://www.linuxquestions.org/questi...-bindfs-23934/
 
Old 01-13-2014, 11:08 PM   #8
silentquasar
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to make autofs mount to specific USB flash drive to specific folder? utahnix Linux - Software 2 11-24-2010 05:27 PM
untar to a specific folder kennmurrah Linux - General 4 05-22-2010 06:06 AM
umask & shared folder abansal Linux - Newbie 1 12-22-2008 07:02 AM
How do I FTP into specific folder hrp2171 Slackware 3 10-18-2004 07:30 PM
Mount specific umask on RH9.0? dirdej Red Hat 1 07-29-2004 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration