Re: sys_chown() hits symlinks

Perry Harrington (
Sun, 18 Jan 1998 00:12:21 -0800 (PST)

> Hi, all. I note that sys_chown() on a symlink will affect the
> uid/gid of the symlink rather than the file that is pointed to. This
> contrasts to sys_chmod() which affects the file at the end of the
> link, as you would expect. A quick check with Solaris shows that for
> both chmod(2) and chown(2) the symlink is traversed.
> Is this inconsistency intentional? If so, why?

Sounds like ther kernel is begging for a lsys_chown. I would speculate it
is so that any joe user can nuke a symlink that he created, otherwise
wouldn't the root:root semantics be a limiting factor? I know that symlinks
are lrwxrwxrwx, it's neccessary to set the owner so any joe user can't just
nuke any symlink (I am aware that current directory owner/perms affect this).
Symlinks should not be at the mercy of the directory perms, files aren't.


> Regards,
> Richard....

Perry Harrington       Linux rules all OSes.    APSoft      ()
email: 			Think Blue. /\