Subject: Re: chmod & symlink broken in 1.6
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 10/29/2002 15:27:14
>> Well, permissions are then set on the symbolic link, not the files
>> they point to
> No, no.
> Normally, symlinks don't have permissions.

For what value of "normally"?  Symlinks have had permissions
approximately forever (certainly every system I've used that had
symlinks, since...when did symlinks show up? I can't recall whether
they were in 4.1c, 4.2, or what).  Those permissions have been ignored
(and approximately impossible to change) on most systems, but they've
been there.  (You can tell by using ln -s with varying umask settings
and noticing that the resulting values are remembered.)  I've never
understood the rationale for ignoring symlinks' mode bits, nor,
especially, for making symlinks transparent to chmod(2).

There are doubtless some reimplementations of symlinks that did away
with their permissions.  I don't consider this as invalidating the
point that they've been there in FFS, where symlinks were brought in,
all along.

> -h      If file is symbolic link, the mode of the link is changed.

> This is a NetBSD extension.

I don't think it's all that NetBSD-specific (ie, I don't think it's
fair to call it a *NetBSD* extension).  Other systems have settable
symlink modes; the only specific example that comes to mind is OSF/1,
but I've never gone looking for others.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B