lkml.org 
[lkml]   [1998]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sys_chown() hits symlinks


On Sun, 18 Jan 1998 chip@atlantic.net wrote:
> According to Linus Torvalds:
> > Actually, the owner of a symlink _does_ matter for sticky directories
> > [...]
> > Essentially, if you cannot change the owner of a symlink, you cannot
> > reliably do a "chown -R" on a directory tree.
>
> Agreeable. But what of "chmod -R", then?

That's another issue - symlinks always have mode lrwxrwxrwx, and nobody
can change that, including root. So a "chmod -R" should just ignore
symlinks (you have do do a "stat()" anyway to check whether it is a
directory, so you get the symlink info at the same time - and know to not
do the chmod() because it would try to follow the link which is not what
you want).

Essentially, yes they have different behaviour, and yes you can consider
that to be strange. However, another way of looking at it is that symlinks
have fundamentally different meanings for chown() and chmod() anyway (one
of them doesn't make any sense), so it is ok to have different behaviour.

I'm not saying that it wouldn't make more sense to have "lchown()", but I
also don't think it makes all that much of a difference.

Linus


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