1833926 Members
3112 Online
110063 Solutions
New Discussion

Easy Perms Question

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Easy Perms Question

We have a directory that has 777 perms that we need to allow all files/dirs created under it inherit the parent, i.e. 777. I've read chmod man and tried a number of different things including setting the directory perms to 6777 but haven't had any luck. I know we could set the users umask in the profile, but the oracle account also needs to create files in the dir so I don't want to do that.

Any ideas on how to force newly created files/dirs to inherit their parent's perms?

Thanks again.
4 REPLIES 4
Stefan Farrelly
Honored Contributor
Solution

Re: Easy Perms Question

You cant do it with permissions on the parent dir. You have to do it either with;

1. umask
or
2. periodic cron job which changes them all.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Shannon Petry
Honored Contributor

Re: Easy Perms Question

The simple answer is that "you can not".

Permissions are inherited by the umask only. System umask is 002 in HP-UX.

The best you can do is set the partent to 4777 which puts a sticky bit on the user creating the file/directory. The users umask is used for permissions of what they create.

So you can set the users umask to 0000 which gives dirs 777 and files 666 permissions by default. Or you can write a script that manually changes perm's periodically.

Regards,
Shannon
Microsoft. When do you want a virus today?
A. Clay Stephenson
Acclaimed Contributor

Re: Easy Perms Question

The permissions of the current working directory (or any other directory for that matter) have absolutely nothing to do with the creation mode of any other files or directories. That is determined by 1) the creation mode mask to the open/creat system call and 2) umask - which subtracts from the creation mode.

In fact, even if you ran a wide-open umask (000) there is no guarantee that the application would creat with 666 (regular files) or 777 (directories) because the creation mode set in the application may be more restrictive.

However, what you can do is create a daemon that periodically traverse this directory tree and sets permissions after the fact.
If it ain't broke, I can fix that.
Chris Wong
Trusted Contributor

Re: Easy Perms Question

Hi,

If you are using JFS, you can create default ACLs on the directory that will be passed on to any newly created files or subdirectories.

If you are not using JFS, the best you can do is force the group owner of all newly created files.

- Chris