Subject: Re: misc/6166: No obvious documentation on symlink modes
To: None <perry@piermont.com>
From: Dave Sainty <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 09/18/1998 00:58:36
Whoops, forgot the sticky bit...
--- bin/ln/symlink.7.orig Sat Feb 7 01:21:24 1998
+++ bin/ln/symlink.7 Fri Sep 18 00:52:49 1998
@@ -107,9 +107,11 @@
would return a file descriptor to the file
.Dq afile .
.Pp
-There are four system calls that do not follow links, and which operate
+There are six system calls that do not follow links, and which operate
on the symbolic link itself.
They are:
+.Xr lchmod 2 ,
+.Xr lchown 2 ,
.Xr lstat 2 ,
.Xr readlink 2 ,
.Xr rename 2 ,
@@ -128,6 +130,23 @@
systems in that the system call
.Xr chown 2
has been changed to follow symbolic links.
+.Pp
+If the filesystem is mounted with the symperm mount option, the symbolic link
+file permission bits have the following effects:
+.Pp
+The
+.Xr readlink 2
+system call requires read permissions on the symbolic link.
+.Pp
+System calls that follow symbolic links will fail without execute/search
+permissions on all the symbolic links followed.
+.Pp
+The write, sticky, set-user-ID-on-execution and set-group-ID-on-execution
+symbolic link mode bits have no effect on any system calls
+.Po
+including
+.Xr execve 2
+.Pc .
.Ss Commands not traversing a file tree.
The second area is symbolic links, specified as command line file
name arguments, to commands which are not traversing a file tree.
@@ -248,7 +267,9 @@
.Dq Li "chown -R user slink directory"
will ignore
.Dq Li slink ,
-because symbolic links in this system do not have owners.
+because the
+.Fl h
+flag must be used to change owners of symbolic links.
Any symbolic links encountered during the tree traversal will also be
ignored.
The command