Operating System - HP-UX
1826647 Members
3057 Online
109695 Solutions
New Discussion

softlink creation ownership of root

 
SOLVED
Go to solution
Shivkumar
Super Advisor

softlink creation ownership of root

Hello,

I created soft links by logging as a different userid than root. But i observed that softlinks got created with ownership as root.

Can anyone explain why it is so and how to create the softlinks with userid logged in to the boxes ?

Thanks,
Shiv


2 REPLIES 2
Tim Nelson
Honored Contributor

Re: softlink creation ownership of root

What version of OS ?

None of my 11.22, 11.23 or 11.31 servers exibit this behavior.

I do not believe the link permissions matter with regards the real file permissions.

After creating the soft link can you remove it as the same user ? Are the real permissions working correctly ?

If so then not a bother.

James R. Ferguson
Acclaimed Contributor
Solution

Re: softlink creation ownership of root

Hi Shiv:

The ownership and/or permisssions of symbolic (soft) links is immaterial. That is, it is the ownership and permissions of the file or directory pointed at by the link that matters. Nothing more, nothing less.

If you create a symbolic link using the 'root' account, then the link will be owned by 'root'. Period.

If you use 'chown' against the symbolic link it it the target (file or directory) of the symbolic link that is changed.

However, if you do 'chown -h' against the symbolic link, the ownership of the *link* and not its target that is altered. This will probably make you happy :-)

Regards!

...JRF...