1829012 Members
2413 Online
109986 Solutions
New Discussion

Directory permission

 
balaji_vvv
Frequent Advisor

Directory permission

I'm running a HP-ux 11iV2 trusted OS. I have a directory which is having 777 permission and users (from application level)writes files to this directory. I have set umask 022 in the profile, but when people creating files from application, its writing files with default OS permission 600. But i need file permission to be 644? Is there any way i can set the directory (sticky), whoever writes files in this directory, should be created with permission 644 and not 600? (I cant use umask as the files are written through application and wont read profile)

Thanks for any suggestion.
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: Directory permission

This sounds like more of an application issue.

Also remember that default OS permissions, if the umask is 000, are 666 for files and 777 for directories.

2 possibilities:

1) The umask for the user that started the application is incorrect. It may be set to 077.

2) The application is coded to create files with 600 permissions.
balaji_vvv
Frequent Advisor

Re: Directory permission

No. This is a 11iV2 trusted system. When i created a file manually, it creates the file as 600 and directory as 700? I checked in other v2 system, it did the same?

Is it expected behaviour?
Patrick Wallek
Honored Contributor

Re: Directory permission

Before you try to create a file, type 'umask'. I suspect you will see '077' as the output.
TTr
Honored Contributor

Re: Directory permission

> When i created a file manually...
Yes this obeys the default umask but you can change it as well.

I am not sure you understood Patricks #1 suggestion. Check how the application gets started. It may be running under a certain user and in that user's profile, you may have a different umask. Also the app may have a startup script with a umask setting in it. If it does not, the umask is internal to the application and you can not change it. Expected behavior or not, that's what it is.
balaji_vvv
Frequent Advisor

Re: Directory permission

Patrick, im seeing 077.

TTr, yes i understood Patricks question. The application wont read the profile, that what i mentioned in my original post.

The only solution i have now is set sudo chmod without password in that application?

Thanks
Dennis Handly
Acclaimed Contributor

Re: Directory permission

>The only solution I have now is set sudo chmod without password in that application?

Before you run the application, set umask to what you want.
If that fails, you can at least use tusc to see what the application does.