cancel
Showing results for 
Search instead for 
Did you mean: 

Does HP-UX ignore SGID bit?

Martin Bruchanov
Occasional Visitor

Does HP-UX ignore SGID bit?

Hi guys,

I want to inherit parent dir permissions on newly created files. But it is look like, that SGID bit on dir (g+s) is ignored, also option default on ACL too. I tried to test g+s bit on GNU/Linux, and the new file inherites permissions as expected, but not on HP-UX 11v3. Also no options as 'nosuid' are set on the filesystem.

Any suggestions? Thanks.
3 REPLIES
Matti_Kurkela
Honored Contributor

Re: Does HP-UX ignore SGID bit?

On HP-UX, if you are root, the SGID bit on directories does not have any effect on you.

For regular users, the SGID bit should work normally, i.e. the group ownership of newly created files/directories is inherited from the parent directory. The permissions are still dictated by user's umask setting, just as usual.

On most Linux distributions, there is a convention to create a personal group for each user, with the group name equal to the username, and GID = UID. This will be each user's primary group. As nobody else should belong to that group, it is safe to use an umask that enables group write access by default (e.g. umask 002 or 007).

This allows collaborative work directories to be set up easily: just create a group, add users to that group (as a secondary group), and create a directory with full group access + setgid to that group. The default umask will seamlessly cause the files to be created for just the right permissions for collaborative work.


On HP-UX, the traditional default primary group for regular user is "users". Since all the regular users belong to this group by default, using a default umask that enables group write access would be a security risk. Therefore, the HP-UX default umask for users is 022, and if the system is hardened for extra security, the default might have been tightened further to 027 or 077.

MK
MK
Ismail Azad
Esteemed Contributor

Re: Does HP-UX ignore SGID bit?

Hi,

As far as my knowledge is concerned the "nosuid" option on mount is supported on HPUX 11iv3. Try mounting a file system with the nosuid option. It should work. The special permissions are concepts on all flavors of unix but you do see fluctuations as said on the previous post.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Martin Bruchanov
Occasional Visitor

Re: Does HP-UX ignore SGID bit?

Thanks for answers. The SGID works as expected, I tested it accidentaly with user in same group as directory group, so I did not see any changes...