Re: How does chown(2) works with symlinks?

Robert Nichols (rnichols@interaccess.com)
Mon, 8 Jul 1996 14:17:50 GMT


In article <m0ud2oF-000h9vC@amador.org>,
Orlando M. Amador <oamador@amador.org> wrote:
:Which file gets changed when a call to chown(2) is done on a symlink?
:The man page gives the impression that it would follow the symlink and
:change the owner of the file pointed by the symlink. Still, if a used
:chown on a symlink now, it will only change the symlink. Was there a
:change to the way it works?

I don't see anything in the manpage that suggests that. In any event,
there is one place where the ownership of the link itself is significant
(deleting the link from a directory which has it's sticky bit set), so
it makes sense to have a way to change that ownership. It's 'chmod'
that follows the link and affects the target, since the permission bits
on the symbolic link itself are meaningless.

-- 
Bob Nichols         rnichols@interaccess.com