annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/man/man3/keyctl_describe.3 @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 .\"
jpayne@68 2 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
jpayne@68 3 .\" Written by David Howells (dhowells@redhat.com)
jpayne@68 4 .\"
jpayne@68 5 .\" This program is free software; you can redistribute it and/or
jpayne@68 6 .\" modify it under the terms of the GNU General Public License
jpayne@68 7 .\" as published by the Free Software Foundation; either version
jpayne@68 8 .\" 2 of the License, or (at your option) any later version.
jpayne@68 9 .\"
jpayne@68 10 .TH KEYCTL_DESCRIBE 3 "4 May 2006" Linux "Linux Key Management Calls"
jpayne@68 11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 12 .SH NAME
jpayne@68 13 keyctl_describe \- describe a key
jpayne@68 14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 15 .SH SYNOPSIS
jpayne@68 16 .nf
jpayne@68 17 .B #include <keyutils.h>
jpayne@68 18 .sp
jpayne@68 19 .BI "long keyctl_describe(key_serial_t " key ", char *" buffer ,
jpayne@68 20 .BI "size_t" buflen ");"
jpayne@68 21 .sp
jpayne@68 22 .BI "long keyctl_describe_alloc(key_serial_t " key ", char **" _buffer ");"
jpayne@68 23 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 24 .SH DESCRIPTION
jpayne@68 25 .BR keyctl_describe ()
jpayne@68 26 describes the attributes of a key as a NUL-terminated string.
jpayne@68 27 .P
jpayne@68 28 The caller must have
jpayne@68 29 .B view
jpayne@68 30 permission on a key to be able to get a description of it.
jpayne@68 31 .P
jpayne@68 32 .I buffer
jpayne@68 33 and
jpayne@68 34 .I buflen
jpayne@68 35 specify the buffer into which the key description will be placed. If the
jpayne@68 36 buffer is too small, the full size of the description will be returned, and no
jpayne@68 37 copy will take place.
jpayne@68 38 .P
jpayne@68 39 .BR keyctl_describe_alloc ()
jpayne@68 40 is similar to
jpayne@68 41 .BR keyctl_describe ()
jpayne@68 42 except that it allocates a buffer big enough to hold the description and
jpayne@68 43 places the description in it. If successful, A pointer to the buffer is
jpayne@68 44 placed in
jpayne@68 45 .IR *_buffer .
jpayne@68 46 The caller must free the buffer.
jpayne@68 47 .P
jpayne@68 48 The description will be a string of format:
jpayne@68 49 .IP
jpayne@68 50 .B "\*(lq%s;%d;%d;%08x;%s\*(rq"
jpayne@68 51 .P
jpayne@68 52 where the arguments are: key type name, key UID, key GID, key permissions mask
jpayne@68 53 and key description.
jpayne@68 54 .P
jpayne@68 55 .B NOTE!
jpayne@68 56 The key description will not contain any semicolons, so that should be
jpayne@68 57 separated out by working backwards from the end of the string. This permits
jpayne@68 58 extra information to be inserted before it by later versions of the kernel
jpayne@68 59 simply by inserting more semicolon-terminated substrings.
jpayne@68 60 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 61 .SH RETURN VALUE
jpayne@68 62 On success
jpayne@68 63 .BR keyctl_describe ()
jpayne@68 64 returns the amount of data placed into the buffer. If the buffer was too
jpayne@68 65 small, then the size of buffer required will be returned, but no data will be
jpayne@68 66 transferred. On error, the value
jpayne@68 67 .B -1
jpayne@68 68 will be returned and
jpayne@68 69 .I errno
jpayne@68 70 will have been set to an appropriate error.
jpayne@68 71 .P
jpayne@68 72 On success
jpayne@68 73 .BR keyctl_describe_alloc ()
jpayne@68 74 returns the amount of data in the buffer, less the NUL terminator. On error, the value
jpayne@68 75 .B -1
jpayne@68 76 will be returned and
jpayne@68 77 .I errno
jpayne@68 78 will have been set to an appropriate error.
jpayne@68 79 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 80 .SH ERRORS
jpayne@68 81 .TP
jpayne@68 82 .B ENOKEY
jpayne@68 83 The key specified is invalid.
jpayne@68 84 .TP
jpayne@68 85 .B EKEYEXPIRED
jpayne@68 86 The key specified has expired.
jpayne@68 87 .TP
jpayne@68 88 .B EKEYREVOKED
jpayne@68 89 The key specified had been revoked.
jpayne@68 90 .TP
jpayne@68 91 .B EACCES
jpayne@68 92 The key exists, but is not
jpayne@68 93 .B viewable
jpayne@68 94 by the calling process.
jpayne@68 95 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 96 .SH LINKING
jpayne@68 97 This is a library function that can be found in
jpayne@68 98 .IR libkeyutils .
jpayne@68 99 When linking,
jpayne@68 100 .B \-lkeyutils
jpayne@68 101 should be specified to the linker.
jpayne@68 102 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
jpayne@68 103 .SH SEE ALSO
jpayne@68 104 .ad l
jpayne@68 105 .nh
jpayne@68 106 .BR keyctl (1),
jpayne@68 107 .BR add_key (2),
jpayne@68 108 .BR keyctl (2),
jpayne@68 109 .BR request_key (2),
jpayne@68 110 .BR keyctl (3),
jpayne@68 111 .BR keyrings (7),
jpayne@68 112 .BR keyutils (7)