Operating System - HP-UX
1830930 Members
2371 Online
110017 Solutions
New Discussion

Re: Uncertain UNIX permissions

 
SOLVED
Go to solution
jerry1
Super Advisor

Uncertain UNIX permissions

We are having a problem with permissions that
are being set on newly created files.
Sometimes the file are created with
rw-rw--- and sometime they are created as
rw-rw-rw. This is with an oracle process that is running.
Oracles umask is 07.
Is there a possible bug with HP-UX bins/libs
or a patch for this kind of behavior?

7 REPLIES 7
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Uncertain UNIX permissions

Hi Jerry,

Umask 007 corresponds to rw-rw---. If the files are getting created with 666 permissions, then I suspect that oracle process is manipulating it's umask to 000 or intentionally creating these files with worldwide access.

Run tusc on this process and see if you can more information on how these files are created.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
jerry1
Super Advisor

Re: Uncertain UNIX permissions

I have already run truss and this is the output. The default of the system is to create dirs and files as 777 666 then apply the umask. So the output of open below is correct for 666. The umask must be passed some other way so it is not listed as a sys call. Remeber. This does not happen all the time. It is random and maybe only 10% of the time. In this case the file was created with
660.


15182: open("/tmp/EDORS/BPC_713.plt",O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) =
Steven E. Protter
Exalted Contributor

Re: Uncertain UNIX permissions

If there is inconsistency, check the umask command output right before the file is created.

I think the final permissions will match the umask every time.

It is possible a cron job or the create script is changing permissions after create.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
jerry1
Super Advisor

Re: Uncertain UNIX permissions

No can do. This is an sql login web frontend
that comunicates with oracle.
You submit a job and it processes the files
in a /tmp directory where they get created
and then sent to a plotter.
When we do testing we can see the files being created. The files are either
666 or 660.

Martha Mueller
Super Advisor

Re: Uncertain UNIX permissions

Is samba involved? You can set file permissions on samba mounts that are different from HP-UX file permissions. We had that happen in the past, where the same directory was set up with two different export share names and two different sets of permissions. When person "A" wrote a file to share mount point of "/home/production" they had file permissions of 666. When person "B" wrote a file to the share mount point of "/home" then subdirectory production, they had file permissions of 644, even though both A and B were writing to the same place on HP-UX, namely /home/production.
Sridhar Bhaskarla
Honored Contributor

Re: Uncertain UNIX permissions

Jerry,

That's open() not creat(). It will create only if a file doesn't exist. Looks like 10% of the time, the file was already existing with pre-set permissions of 0660.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
jerry1
Super Advisor

Re: Uncertain UNIX permissions

That's what I don't understand.
The file does not exist and when it is
created truss only shows open call.