cancel
Showing results for 
Search instead for 
Did you mean: 

File Permission.

Narendra Uttekar
Regular Advisor

File Permission.

Hi,

 

When we create a file through SAP application on HP-UX filesystem it is having file permission as rw-rw---- , But we want others group atleast read permission. But on other system we have file permission correct i.e. rw-rw-rw- . Both systems are HP Itanium Blade servers and OS HP-UX 11i V3. I tried comparing both systems but not able to find where to make changes.

 

On both system i check umask value and both are same i.e. 022.

 

Please let me know how to fix this problem i want atleast read permission for other group.

 

Thanks,

Narendra

8 REPLIES
Matti_Kurkela
Honored Contributor

Re: File Permission.

The umask is not a system-wide setting: each user, even each single process can have its own umask setting.

 

When a new process is created (using some variety of a fork() system call), the new process will inherit the umask setting of its parent process. Even if the current default umask is 022, if umask *was* 000 when the SAP application was started, or if the start-up script for the SAP application includes the "umask 000" command, the SAP application process may still have umask 000.

 

If an application is started at system boot with a script located in /sbin/init.d, it may get umask 000 unless the startup script specifically sets some other umask value.

 

Neither rw-rw---- nor rw-rw-rw- matches the umask value of 022.

  • To create rw-rw----, the umask would have to be 006 or 007.
  • To create rw-rw-rw-, umask 000 would be needed.

An application may also explicitly set permissions for any files it creates, or even change its own umask, if it is programmed to do so.

 

You should now:

  • restart SAP if possible, and see if the permissions of new files will be different after that. (This proves SAP was using some old umask value from the time it was originally started. Restarting SAP should make it use the current umask value.)
  • inspect the SAP start-up script, and see if it includes a umask command. If you find one, adjust the value to suit your needs; if you don't find one, consider adding it to make absolutely sure SAP will be using the umask you've chosen.
  • inspect the SAP configuration: if SAP is programmed to adjust its own umask or to set specific permissions to any files it creates, those settings are most likely configurable. (Unfortunately I don't know anything at all about SAP, so I cannot suggest where those settings might be found.)
MK
Ralf Seefeldt
Valued Contributor

Re: File Permission.

Hi,

 

I adhere to MKs answer.

 

we have set the umask in the loginscripts (.profile) of the SAP users.


May be, you find your settings there, too.

 

Bye

Ralf

Narendra Uttekar
Regular Advisor

Re: File Permission.

Hi Ralf,

I have set the umask i.e. 000 in the loginscripts (.profile) of SAP user i.e. sidadm. When I login with SAP user i.e. sidadm I am able to see the umask value set to 000. I restarted the SAP application but still same permission i.e. rw-rw----. I am not able to trace from where the umask value is inherited for files created from SAP application is getting the umask value even though now I have set the umask value to 000.

 

It will be good if you tell me beside .profile where I will have to set the umask value.

 

Thanks,

Narendra

Dennis Handly
Acclaimed Contributor

Re: File Permission.

>I restarted the SAP application but still same permission i.e. rw-rw----.

 

If you can restart the app manually after you login and umask is set properly, then you could use tusc to see where it is changed.  Perhaps the app sets umask, either to a fixed value or from a configuration file?

Narendra Uttekar
Regular Advisor

Re: File Permission.

Hi Dennis,

When i try to use tusc getting error as below,

 

tusc: Command not found.

 

Thanks,

Narendra

Dennis Handly
Acclaimed Contributor

Re: File Permission.

>tusc: Command not found.

 

You need to install this from the Porting Center:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-8.1/

 

And then to run:

tusc -fp -ea -o tusc.out command-to-trace args-command ...

 

You should see an entry like:

[18037] umask(0) ......................................... = 02

 

Where "(0)" is the new value and 02 is the old.

Narendra Uttekar
Regular Advisor

Re: File Permission.

Hi Dennis,

I installed the tusc from the Porting Center.

 

But when i execute the command as you listed below getting error as below,

 

/usr/local/bin/tusc -fp -ea -o tusc.out command-to-trace args-command
tusc: command-to-trace: No such file or directory

 

Please can you let me know the exact command...

 

Thanks,

Narendra

 

 

Dennis Handly
Acclaimed Contributor

Re: File Permission.

>command-to-trace args-command

>Please can you let me know the exact command

 

I wrote it that way to indicate you should fill it in by whatever command you use to invoke your SAP application.