lkml.org 
[lkml]   [1996]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: How does chown(2) works with symlinks?
Date
> 
> 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
>
>

The fact that chmod(2) could return an 'ELOOP' error (According to
manpages 1.8) suggest that chmod() used to follow the symlink. This
not the case anymore.

Personally I think that it should resolve the symlink. Access and
ownership should be controled by the file that the symlink points to.

Saludos,
Orlando

--
Orlando M. Amador oamador@amador.org
Avenida Country Club #1027 (787) 898-5181
Camuy, PR 00627 Fax: (787) 898-6686



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.090 / U:14.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site