diff options
| author | Alejandro Colomar <alx@kernel.org> | 2024-07-11 00:11:27 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2024-08-21 23:51:08 +0200 |
| commit | f76f39a485bab8258956f1f56c940039589d8306 (patch) | |
| tree | fc1ef56a15b9df56bc8cd23f0ff45ca5ddd329ce | |
| parent | f9d3bfb2fed3e3184060ca0804a5728944fd2144 (diff) | |
| download | man-pages-f76f39a485bab8258956f1f56c940039589d8306.tar.gz | |
keyctl.2, KEYCTL_CLEAR.2const: Split KEYCTL_CLEAR from keyctl(2)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
| -rw-r--r-- | man/man2/keyctl.2 | 34 | ||||
| -rw-r--r-- | man/man2const/KEYCTL_CLEAR.2const | 77 |
2 files changed, 79 insertions, 32 deletions
diff --git a/man/man2/keyctl.2 b/man/man2/keyctl.2 index 9cdafe85e0..2ba0c1f8cb 100644 --- a/man/man2/keyctl.2 +++ b/man/man2/keyctl.2 @@ -55,37 +55,8 @@ are: .BR KEYCTL_SETPERM (2const) .TQ .BR KEYCTL_DESCRIBE (2const) -.TP -.B KEYCTL_CLEAR -Clear the contents of (i.e., unlink all keys from) a keyring. -.IP -The ID of the key -(which must be of keyring type) -.\" or the error ENOTDIR results -is provided in -.I arg2 -(cast to -.IR key_serial_t ). -.\" According to Documentation/security/keys.txt: -.\" This function can also be used to clear special kernel keyrings if they -.\" are appropriately marked if the user has CAP_SYS_ADMIN capability. The -.\" DNS resolver cache keyring is an example of this. -.IP -The caller must have -.I write -permission on the keyring. -.IP -The arguments -.IR arg3 , -.IR arg4 , -and -.I arg5 -are ignored. -.IP -This operation is exposed by -.I libkeyutils -via the function -.BR keyctl_clear (3). +.TQ +.BR KEYCTL_CLEAR (2const) .TP .BR KEYCTL_LINK " (since Linux 2.6.10)" Create a link from a keyring to a key. @@ -1672,7 +1643,6 @@ main(int argc, char *argv[]) .\" There is a man page, but this function seems not to exist .BR keyctl (3), .BR keyctl_assume_authority (3), -.BR keyctl_clear (3), .BR keyctl_dh_compute (3), .BR keyctl_dh_compute_alloc (3), .BR keyctl_get_persistent (3), diff --git a/man/man2const/KEYCTL_CLEAR.2const b/man/man2const/KEYCTL_CLEAR.2const new file mode 100644 index 0000000000..4c5cd2d259 --- /dev/null +++ b/man/man2const/KEYCTL_CLEAR.2const @@ -0,0 +1,77 @@ +.\" Copyright 2016, Michael Kerrisk <mtk.manpages@gmail.com> +.\" Copyright 2016, Eugene Syromyatnikov <evgsyr@gmail.com> +.\" A very few fragments remain from an earlier version of this page +.\" written by David Howells (dhowells@redhat.com) +.\" Copyright 2024, Alejandro Colomar <alx@kernel.org> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.TH KEYCTL_CLEAR 2const (date) "Linux man-pages (unreleased)" +.SH NAME +KEYCTL_CLEAR +\- +clear a keyring +.SH LIBRARY +Standard C library +.RI ( libc ,\~ \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <linux/keyctl.h>" " /* Definition of " KEY* " constants */" +.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" +.B #include <unistd.h> +.P +.BI "long syscall(SYS_keyctl, KEYCTL_CLEAR, unsigned long " arg2 , +.BI " unsigned long " arg3 ", unsigned long " arg4 , +.BI " unsigned long " arg5 ); +.fi +.SH DESCRIPTION +.TP +.B KEYCTL_CLEAR +Clear the contents of (i.e., unlink all keys from) a keyring. +.IP +The ID of the key +(which must be of keyring type) +.\" or the error ENOTDIR results +is provided in +.I arg2 +(cast to +.IR key_serial_t ). +.\" According to Documentation/security/keys.txt: +.\" This function can also be used to clear special kernel keyrings if they +.\" are appropriately marked if the user has CAP_SYS_ADMIN capability. The +.\" DNS resolver cache keyring is an example of this. +.IP +The caller must have +.I write +permission on the keyring. +.IP +The arguments +.IR arg3 , +.IR arg4 , +and +.I arg5 +are ignored. +.IP +This operation is exposed by +.I libkeyutils +via the function +.BR keyctl_clear (3). +.SH RETURN VALUE +On success, +0 is returned. +.P +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH VERSIONS +A wrapper is provided in the +.I libkeyutils +library: +.BR keyctl_clear (3). +.SH STANDARDS +Linux. +.SH HISTORY +Linux 2.6.10. +.SH SEE ALSO +.BR keyctl (2), +.BR keyctl_clear (3) |
