summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-05-24 16:32:11 +0000
committerpeter <peter@FreeBSD.org>1996-05-24 16:32:11 +0000
commit0f5a7440b6758c699bf0520a7e28678f05d269a7 (patch)
treedad89c1fa460db1f6a988e262d7f74fbbd63fcf7 /lib/libc/sys
parent9453593a7d6b8b4929584c55937cbc51e5de1a67 (diff)
downloadFreeBSD-src-0f5a7440b6758c699bf0520a7e28678f05d269a7.zip
FreeBSD-src-0f5a7440b6758c699bf0520a7e28678f05d269a7.tar.gz
Document that the superuser cannot override link() and unlink() on
directories, and mention that it was historical practice.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/link.211
-rw-r--r--lib/libc/sys/unlink.211
2 files changed, 17 insertions, 5 deletions
diff --git a/lib/libc/sys/link.2 b/lib/libc/sys/link.2
index d160786..4c27ab9 100644
--- a/lib/libc/sys/link.2
+++ b/lib/libc/sys/link.2
@@ -74,7 +74,6 @@ both
and
.Fa name2
must be in the same file system.
-Unless the caller is the super-user,
.Fa name1
may not be a directory.
.Sh RETURN VALUES
@@ -113,8 +112,7 @@ does exist.
.It Bq Er EPERM
The file named by
.Fa name1
-is a directory and the effective
-user ID is not super-user.
+is a directory.
.It Bq Er EXDEV
The link named by
.Fa name2
@@ -149,3 +147,10 @@ is outside the process's allocated address space.
is expected to
conform to IEEE Std 1003.1-1988
.Pq Dq Tn POSIX .
+.Sh HISTORY
+.Pp
+The
+.Nm
+system call traditionally allows the super-user to link directories which
+corrupts the filesystem coherency. This implementation no longer permits
+it.
diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2
index 78221bc..1f46945 100644
--- a/lib/libc/sys/unlink.2
+++ b/lib/libc/sys/unlink.2
@@ -56,6 +56,8 @@ all resources associated with the file are reclaimed.
If one or more process have the file open when the last link is removed,
the link is removed, but the removal of the file is delayed until
all references to it have been closed.
+.Fa path
+may not be a directory.
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and
@@ -83,8 +85,7 @@ to be removed.
.It Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
.It Bq Er EPERM
-The named file is a directory and the effective user ID
-of the process is not the super-user.
+The named file is a directory.
.It Bq Er EPERM
The directory containing the file is marked sticky,
and neither the containing directory nor the file to be removed
@@ -110,3 +111,9 @@ points outside the process's allocated address space.
An
.Nm
function call appeared in Version 6 AT&T UNIX.
+.Pp
+The
+.Nm
+system call traditionally allows the super-user to unlink directories which
+can damage the filesystem integrity. This implementation no longer permits
+it.
OpenPOWER on IntegriCloud