summaryrefslogtreecommitdiff
path: root/lib/libc/sys/unlink.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/unlink.2')
-rw-r--r--lib/libc/sys/unlink.226
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/libc/sys/unlink.2 b/lib/libc/sys/unlink.2
index 2e0ed54b0a297..c6c6a150c1a20 100644
--- a/lib/libc/sys/unlink.2
+++ b/lib/libc/sys/unlink.2
@@ -28,7 +28,7 @@
.\" @(#)unlink.2 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd October 20, 2018
+.Dd November 11, 2018
.Dt UNLINK 2
.Os
.Sh NAME
@@ -90,8 +90,13 @@ and
.Fa path
as a directory, not a normal file.
.It Dv AT_BENEATH
-Only unlink files and directories which are beneath of the starting
+Only unlink files and directories which are beneath of the topping
directory.
+See the description of the
+.Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
.El
.Pp
If
@@ -204,14 +209,23 @@ is neither
.Dv AT_FDCWD
nor a file descriptor associated with a directory.
.It Bq Er ENOTCAPABLE
+.Fa path
+is an absolute path,
+or contained a ".." component leading to a
+directory outside of the directory hierarchy specified by
+.Fa fd ,
+and the process is in capability mode.
+.It Bq Er ENOTCAPABLE
The
.Dv AT_BENEATH
-flag was specified but
+flag was provided to
+.Fn unlinkat ,
+and the absolute
.Fa path
-is not strictly relative to the starting directory.
-For example,
+does not have its tail fully contained under the topping directory,
+or the relative
.Fa path
-is absolute or includes a ".." component that escapes the starting directory.
+escapes it.
.El
.Sh SEE ALSO
.Xr chflags 2 ,