KEYCTL_DESCRIBE


HOME

KEYCTL_DESCRIBE

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
LINKING
SEE ALSO

NAME

keyctl_describe āˆ’ Describe a key

SYNOPSIS

#include <keyutils.h>

long keyctl_describe(key_serial_t key, char *buffer,
size_t
buflen);

long keyctl_describe_alloc(key_serial_t key, char **_buffer);

DESCRIPTION

keyctl_describe() describes the attributes of a key as a NUL-terminated string.

The caller must have view permission on a key to be able to get a description of it.

buffer and buflen specify the buffer into which the key description will be placed. If the buffer is too small, the full size of the description will be returned, and no copy will take place.

keyctl_describe_alloc() is similar to keyctl_describe() except that it allocates a buffer big enough to hold the description and places the description in it. If successful, A pointer to the buffer is placed in *_buffer. The caller must free the buffer.

The description will be a string of format:

ā€œ%s;%d;%d;%08x;%sā€

where the arguments are: key type name, key UID, key GID, key permissions mask and key description.

NOTE! The key description will not contain any semicolons, so that should be separated out by working backwards from the end of the string. This permits extra information to be inserted before it by later versions of the kernel simply by inserting more semicolon-terminated substrings.

RETURN VALUE

On success keyctl_describe() returns the amount of data placed into the buffer. If the buffer was too small, then the size of buffer required will be returned, but no data will be transferred. On error, the value -1 will be returned and errno will have been set to an appropriate error.

On success keyctl_describe_alloc() returns the amount of data in the buffer, less the NUL terminator. On error, the value -1 will be returned and errno will have been set to an appropriate error.

ERRORS

ENOKEY

The key specified is invalid.

EKEYEXPIRED

The key specified has expired.

EKEYREVOKED

The key specified had been revoked.

EACCES

The key exists, but is not viewable by the calling process.

LINKING

This is a library function that can be found in libkeyutils. When linking, -lkeyutils should be specified to the linker.

SEE ALSO

keyctl(1),
add_key
(2),
keyctl
(2),
request_key
(2),
keyctl
(3),
keyutils
(7),
keyrings
(7)




More Linux Commands

manpages/groff_mdoc.7.html
groff_mdoc(7) - reference for groff's mdoc implementation...
groff_mdoc.7 - In most cases the first text in the DESCRIPTION section is a brief paragraph on the command, function or file, followed by a lexical list of opti

manpages/wcsncat.3.html
wcsncat(3) - concatenate two wide-character strings.........
The wcsncat() function is the wide-character equivalent of the strncat(3) function. It copies at most n wide characters from the wide-character string pointed t

manpages/ipcrm.1.html
ipcrm(1) - remove a message queue, semaphore set or shared m
ipcrm removes System V interprocess communication (IPC) objects and associated data structures from the system. In order to delete such objects, you must be sup

manpages/IsFunctionKey.3.html
IsFunctionKey(3) - keysym classification macros (Man Page)
The IsCursorKey macro returns True if the specified KeySym is a cursor key. The IsFunctionKey macro returns True if the KeySym is a function key. The IsKeypadKe

manpages/TIFFClose.3tiff.html
TIFFClose(3tiff) - close a previously opened TIFF file......
TIFFClose closes a file that was previously opened with TIFFOpen(3TIFF). Any buffered data are flushed to the file, including the contents of the current direct

manpages/glutSpecialUpFunc.3.html
glutSpecialUpFunc(3) - sets the special keyboard up (key rel
glutSpecialUpFunc sets the special keyboard up (key release) callback for the current window. The special keyboard up callback is triggered when keyboard functi

manpages/run-with-aspell.1.html
run-with-aspell(1) script to help use GNU Aspell as an ispel
The recommended way to use Aspell as a replacement for Ispell is to change the Ispell command from within the program being used. If that is not possible, the r

manpages/glSelectBuffer.3gl.html
glSelectBuffer(3gl) - establish a buffer for selection mode
glSelectBuffer has two arguments: buffer is a pointer to an array of unsigned integers, and size indicates the size of the array. buffer returns values from the

manpages/xev.1.html
xev(1) - print contents of X events - Linux manual page.....
Xev creates a window and then asks the X server to send it events whenever anything happens to the window (such as it being moved, resized, typed in, clicked in

manpages/FcInitLoadConfig.3.html
FcInitLoadConfig(3) - load configuration - Linux man page...
Loads the default configuration file and returns the resulting configuration. Does not load any font information. VERSION Fontconfig version 2.8.0 FcInitLoadCon

manpages/XvUngrabPort.3.html
XvUngrabPort(3) - release port grabbed for video operation
XvUngrabPort(3) releases a grabbed port. If time specifies a time before the last XvGrabPort(3) was executed, the request is ignored. RETURN VALUES [Success] Re

manpages/db.3.html
db(3) - database access methods (Library - Linux man page)
db.3 - Note well: This page documents interfaces provided in glibc up until version 2.1. Since version 2.2, glibc no longer provides these interfaces. Probably,





We can't live, work or learn in freedom unless the software we use is free.