From: Alejandro Colomar Date: Wed, 10 Jul 2024 20:42:59 +0000 (+0200) Subject: KEYCTL_DESCRIBE.2const: Tweak after split X-Git-Tag: man-pages-6.10~181^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9d3bfb2fed3e3184060ca0804a5728944fd2144;p=thirdparty%2Fman-pages.git KEYCTL_DESCRIBE.2const: Tweak after split Signed-off-by: Alejandro Colomar --- diff --git a/man/man2const/KEYCTL_DESCRIBE.2const b/man/man2const/KEYCTL_DESCRIBE.2const index f0f2e90a2..621706d1c 100644 --- a/man/man2const/KEYCTL_DESCRIBE.2const +++ b/man/man2const/KEYCTL_DESCRIBE.2const @@ -20,39 +20,30 @@ Standard C library .BR "#include " " /* Definition of " SYS_* " constants */" .B #include .P -.BI "long syscall(SYS_keyctl, KEYCTL_DESCRIBE, unsigned long " arg2 , -.BI " unsigned long " arg3 ", unsigned long " arg4 , -.BI " unsigned long " arg5 ); +.BI "long syscall(SYS_keyctl, KEYCTL_DESCRIBE, key_serial_t " key , +.BI " char " desc "[_Nullable ." size "], size_t " size ); .fi .SH DESCRIPTION -.TP -.BR KEYCTL_DESCRIBE " (since Linux 2.6.10)" Obtain a string describing the attributes of a specified key. -.IP +.P The ID of the key to be described is specified in -.I arg2 -(cast to -.IR key_serial_t ). +.IR key . The descriptive string is returned in the buffer pointed to by -.I arg3 -(cast to -.IR char\~* ); -.I arg4 -(cast to -.IR size_t ) +.IR desc ; +.I size specifies the size of that buffer in bytes. -.IP +.P The key must grant the caller .I view permission. -.IP +.P The returned string is null-terminated and contains the following information about the key: -.IP +.P .in +4n .IR type ; uid ; gid ; perm ; description .in -.IP +.P In the above, .I type and @@ -65,13 +56,13 @@ are decimal strings, and .I perm is a hexadecimal permissions mask. The descriptive string is written with the following format: -.IP +.P .in +4n .EX %s;%d;%d;%08x;%s .EE .in -.IP +.P .B Note: the intention is that the descriptive string should .B be extensible in future kernel versions. In particular, the @@ -86,9 +77,9 @@ it should be parsed by working backwards from the end of the string to find the last semicolon. This allows future semicolon-delimited fields to be inserted in the descriptive string in the future. -.IP +.P Writing to the buffer is attempted only when -.I arg3 +.I desc is non-NULL and the specified buffer size is large enough to accept the descriptive string (including the terminating null byte). @@ -97,20 +88,10 @@ is large enough to accept the descriptive string .\" security/keyctl.c In order to determine whether the buffer size was too small, check to see if the return value of the operation is greater than -.IR arg4 . -.IP -The -.I arg5 -argument is ignored. -.IP -This operation is exposed by -.I libkeyutils -via the function -.BR keyctl_describe (3). +.IR size . .SH RETURN VALUE -.TP -.B KEYCTL_DESCRIBE -The size of the description (including the terminating null byte), +On success, +the size of the description (including the terminating null byte), irrespective of the provided buffer size. .P On error, \-1 is returned, and