Operating System - HP-UX
1834454 Members
2503 Online
110067 Solutions
New Discussion

Sticky bit on symlinks (lchmod)

 
Victor Ciurus
Occasional Advisor

Sticky bit on symlinks (lchmod)

Hi everyone!

I am running a A class HP-UX v11.00 sever and I have accidentally deleted the symlink that pointed from /usr/bin to /bin. I managed to put the symlink back yet I'm not able to get back the sticky bit on the symlink as it was before (it was lr-xr-xr-t).
Obviously any change to the symlink causes the /usr/bin directory to get its permissions changed.
Iread smth about "...a symbolic link that has its sticky bit set is
called a transition link (i.e. links to ease the transition to the new
SVR4 filesystem layout)..." and that "In order to set the sticky bit on a symlink, one must use the undocumented
lchmod system call (i.e. lchmod("/bin", 041777))."

Yet I don't seem to get it right. How do I get that sticky bit back on the symlink without chaging permissions on the target directory?

Thnx a lot,
Vic
I was born intelligent! Education ruined me.
4 REPLIES 4
John Palmer
Honored Contributor

Re: Sticky bit on symlinks (lchmod)

The sticky bit doesn't prevent the link from working. Provided the link is there then your'e OK. I believe that it's only used by the tlremove command to identify links that should be removed.

As S.K. says, tlinstall will create it properly.

Regards,
John
S.K. Chan
Honored Contributor

Re: Sticky bit on symlinks (lchmod)

It's not documented clearly but you can run ..
# /opt/upgrade/bin/tlinstall
to recreate the transition links. Since I've never run it, I actually tested on my 11.0.
# cd /
# rm bin
==> Removing the "sticky bit" link to /usr/bin
# /opt/upgrade/bin/tlinstall
# ll bin
==> The "sticky bit" sym link is restored.

James R. Ferguson
Acclaimed Contributor

Re: Sticky bit on symlinks (lchmod)

Hi:

You can easily rectify this. These are "transition" links which appeared when the filesystem layout changed at 10.0. To re-establish lost ones, do:

# /opt/upgrade/bin/tlinstall -l -v

You should also find man pages:

# /opt/upgrade/share/man/man1m.Z/tlinstall.1
m

Regards!

...JRF...
Victor Ciurus
Occasional Advisor

Re: Sticky bit on symlinks (lchmod)

Thank you everyone!
I've fixed it by running '/opt/upgrade/bin/tlinstall'. I should have got the guts to do it earlier but I haven'T (--> sticky bit) :D
I was born intelligent! Education ruined me.