aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-07-03 16:54:35 +0200
committerAlejandro Colomar <alx@kernel.org>2024-08-21 23:51:07 +0200
commitbe5efa06e15992708ff1da3e19730716bf0b931f (patch)
tree8af9ab0c237ef2a2d6af5b7c836f0da65b5a58c6
parent548c5aa3e35accf7a605689940118a29e2411a0f (diff)
downloadman-pages-be5efa06e15992708ff1da3e19730716bf0b931f.tar.gz
keyctl.2, KEYCTL_CHOWN.2const: Split KEYCTL_CHOWN from keyctl(2)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2/keyctl.248
-rw-r--r--man/man2const/KEYCTL_CHOWN.2const88
2 files changed, 91 insertions, 45 deletions
diff --git a/man/man2/keyctl.2 b/man/man2/keyctl.2
index 953884bc55..1906cb8fd3 100644
--- a/man/man2/keyctl.2
+++ b/man/man2/keyctl.2
@@ -49,49 +49,8 @@ are:
.BR KEYCTL_UPDATE (2const)
.TQ
.BR KEYCTL_REVOKE (2const)
-.TP
-.BR KEYCTL_CHOWN " (since Linux 2.6.10)"
-Change the ownership (user and group ID) of a key.
-.IP
-The
-.I arg2
-argument (cast to
-.IR key_serial_t )
-contains the key ID.
-The
-.I arg3
-argument (cast to
-.IR uid_t )
-contains the new user ID (or \-1 in case the user ID shouldn't be changed).
-The
-.I arg4
-argument (cast to
-.IR gid_t )
-contains the new group ID (or \-1 in case the group ID shouldn't be changed).
-.IP
-The key must grant the caller
-.I setattr
-permission.
-.IP
-For the UID to be changed, or for the GID to be changed to a group
-the caller is not a member of, the caller must have the
-.B CAP_SYS_ADMIN
-capability (see
-.BR capabilities (7)).
-.IP
-If the UID is to be changed, the new user must have sufficient
-quota to accept the key.
-The quota deduction will be removed from the old user
-to the new user should the UID be changed.
-.IP
-The
-.I arg5
-argument is ignored.
-.IP
-This operation is exposed by
-.I libkeyutils
-via the function
-.BR keyctl_chown (3).
+.TQ
+.BR KEYCTL_CHOWN (2const)
.TP
.BR KEYCTL_SETPERM " (since Linux 2.6.10)"
Change the permissions of the key with the ID provided in the
@@ -268,7 +227,7 @@ This permission allows a key's UID, GID, and permissions mask to be changed.
.IP
This permission is required for the
.BR KEYCTL_REVOKE (2const),
-.BR KEYCTL_CHOWN ,
+.BR KEYCTL_CHOWN (2const),
and
.B KEYCTL_SETPERM
operations.
@@ -2009,7 +1968,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_chown (3),
.BR keyctl_clear (3),
.BR keyctl_describe (3),
.BR keyctl_describe_alloc (3),
diff --git a/man/man2const/KEYCTL_CHOWN.2const b/man/man2const/KEYCTL_CHOWN.2const
new file mode 100644
index 0000000000..d482c32ebd
--- /dev/null
+++ b/man/man2const/KEYCTL_CHOWN.2const
@@ -0,0 +1,88 @@
+.\" 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_CHOWN 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+KEYCTL_CHOWN
+\-
+change the ownership of a key
+.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_CHOWN, unsigned long " arg2 ,
+.BI " unsigned long " arg3 ", unsigned long " arg4 );
+.fi
+.SH DESCRIPTION
+.TP
+.BR KEYCTL_CHOWN " (since Linux 2.6.10)"
+Change the ownership (user and group ID) of a key.
+.IP
+The
+.I arg2
+argument (cast to
+.IR key_serial_t )
+contains the key ID.
+The
+.I arg3
+argument (cast to
+.IR uid_t )
+contains the new user ID (or \-1 in case the user ID shouldn't be changed).
+The
+.I arg4
+argument (cast to
+.IR gid_t )
+contains the new group ID (or \-1 in case the group ID shouldn't be changed).
+.IP
+The key must grant the caller
+.I setattr
+permission.
+.IP
+For the UID to be changed, or for the GID to be changed to a group
+the caller is not a member of, the caller must have the
+.B CAP_SYS_ADMIN
+capability (see
+.BR capabilities (7)).
+.IP
+If the UID is to be changed, the new user must have sufficient
+quota to accept the key.
+The quota deduction will be removed from the old user
+to the new user should the UID be changed.
+.IP
+The
+.I arg5
+argument is ignored.
+.IP
+This operation is exposed by
+.I libkeyutils
+via the function
+.BR keyctl_chown (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_chown (3).
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 2.6.10.
+.SH SEE ALSO
+.BR keyctl (2),
+.BR keyctl_chown (3)