Skip to content

Commit

Permalink
cap_*(2): Document ENOSYS behavior.
Browse files Browse the repository at this point in the history
Summary:
All cap_* system calls would fail when capability mode support is
not present.

MFC after:	2 weeks
Reviewed by:	emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D38976
  • Loading branch information
delphij committed Mar 10, 2023
1 parent 5abaf08 commit 75798f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
7 changes: 3 additions & 4 deletions lib/libc/sys/cap_enter.2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 5, 2020
.Dd March 9, 2023
.Dt CAP_ENTER 2
.Os
.Sh NAME
Expand Down Expand Up @@ -113,9 +113,8 @@ system calls
will fail if:
.Bl -tag -width Er
.It Bq Er ENOSYS
The kernel is compiled without:
.Pp
.Cd "options CAPABILITY_MODE"
The running kernel was compiled without
.Cd "options CAPABILITY_MODE" .
.El
.Pp
The
Expand Down
5 changes: 4 additions & 1 deletion lib/libc/sys/cap_fcntls_limit.2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 5, 2020
.Dd March 9, 2023
.Dt CAP_FCNTLS_LIMIT 2
.Os
.Sh NAME
Expand Down Expand Up @@ -110,6 +110,9 @@ argument is not a valid descriptor.
The
.Fa fcntlrightsp
argument points at an invalid address.
.It Bq Er ENOSYS
The running kernel was compiled without
.Cd "options CAPABILITY_MODE" .
.El
.Sh SEE ALSO
.Xr cap_ioctls_limit 2 ,
Expand Down
29 changes: 14 additions & 15 deletions lib/libc/sys/cap_ioctls_limit.2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 5, 2020
.Dd March 9, 2023
.Dt CAP_IOCTLS_LIMIT 2
.Os
.Sh NAME
Expand Down Expand Up @@ -109,8 +109,11 @@ On failure the value
.Va -1
is returned and the global variable errno is set to indicate the error.
.Sh ERRORS
The
.Fn cap_ioctls_limit
succeeds unless:
and
.Fn cap_ioctls_get
system calls will fail if:
.Bl -tag -width Er
.It Bq Er EBADF
The
Expand All @@ -120,6 +123,15 @@ argument is not a valid descriptor.
The
.Fa cmds
argument points at an invalid address.
.It Bq Er ENOSYS
The running kernel was compiled without
.Cd "options CAPABILITY_MODE" .
.El
.Pp
The
.Fn cap_ioctls_limit
system call may also return the following errors:
.Bl -tag -width Er
.It Bq Er EINVAL
The
.Fa ncmds
Expand All @@ -131,19 +143,6 @@ would expand the list of allowed
.Xr ioctl 2
commands.
.El
.Pp
.Fn cap_ioctls_get
succeeds unless:
.Bl -tag -width Er
.It Bq Er EBADF
The
.Fa fd
argument is not a valid descriptor.
.It Bq Er EFAULT
The
.Fa cmds
argument points at invalid address.
.El
.Sh SEE ALSO
.Xr cap_fcntls_limit 2 ,
.Xr cap_rights_limit 2 ,
Expand Down
5 changes: 4 additions & 1 deletion lib/libc/sys/cap_rights_limit.2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 5, 2020
.Dd March 9, 2023
.Dt CAP_RIGHTS_LIMIT 2
.Os
.Sh NAME
Expand Down Expand Up @@ -120,6 +120,9 @@ argument is not a valid active descriptor.
.It Bq Er EINVAL
An invalid right has been requested in
.Fa rights .
.It Bq Er ENOSYS
The running kernel was compiled without
.Cd "options CAPABILITY_MODE" .
.It Bq Er ENOTCAPABLE
The
.Fa rights
Expand Down

0 comments on commit 75798f9

Please sign in to comment.