KEYCTL_GET_SECURITY



KEYCTL_GET_SECURITY

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
LINKING
SEE ALSO

NAME

keyctl_get_security − Retrieve a key’s security context

SYNOPSIS

#include <keyutils.h>

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

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

DESCRIPTION

keyctl_get_security() retrieves the security context of a key as a NUL-terminated string. This will be rendered in a form appropriate to the LSM in force - for instance, with SELinux, it may look like

unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

The caller must have view permission on a key to be able to get its security context.

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

keyctl_get_security_alloc() is similar to keyctl_get_security() except that it allocates a buffer big enough to hold the string and copies the string into it. If successful, A pointer to the buffer is placed in *_buffer. The caller must free the buffer.

RETURN VALUE

On success keyctl_get_security() 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_get_security_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/X11::Protocol::Ext::RENDER.3pm.html
X11::Protocol::Ext::RENDER.3pm..............................
The RENDER extension adds a new set of drawing primitives which effectively represent a replacement of the drawing routines in the core protocol, redesigned bas

manpages/pthread_setcancelstate.3.html
pthread_setcancelstate(3) - set cancelability state and type
The pthread_setcancelstate() sets the cancelability state of the calling thread to the value given in state. The previous cancelability state of the thread is r

manpages/FcPatternGet.3.html
FcPatternGet(3) - Return a value from a pattern (Man Page)
Returns in v the idth value associated with the property object. The value returned is not a copy, but rather refers to the data stored within the pattern direc

manpages/slk_attroff.3ncurses.html
slk_attroff(3ncurses) - curses soft label routines (ManPage)
The slk* functions manipulate the set of soft function-key labels that exist on many terminals. For those terminals that do not have soft labels, curses takes o

manpages/pthread_getaffinity_np.3.html
pthread_getaffinity_np(3) - set/get CPU affinity of a thread
The pthread_setaffinity_np() function sets the CPU affinity mask of the thread thread to the CPU set pointed to by cpuset. If the call is successful, and the th

manpages/XF86MiscGetKbdSettings.3.html
XF86MiscGetKbdSettings(3) - Extension library for the XFree8
These functions provide an interface to the XFree86-Misc extension which allows various server settings to be queried and changed dynamically. Applications that

manpages/zoomsh.1.html
zoomsh(1) - ZOOM shell (Commands - Linux manual page).......
zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets. You may pass one or more c

manpages/XtCallbackExclusive.3.html
XtCallbackExclusive(3) - map a pop-up - Linux manual page...
The XtPopup function performs the following: * Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell. * Generates an error if the shells popped_up

manpages/klogctl.3.html
klogctl(3) - read and/or clear kernel message ring buffer; s
If you need the C library function syslog() (which talks to syslogd(8)), then look at syslog(3). The system call of this name is about controlling the kernel pr

manpages/Tk_DeleteImage.3.html
Tk_DeleteImage(3) - Destroy an image. - Linux manual page...
Tk_DeleteImage deletes the image given by interp and name, if there is one. All instances of that image will redisplay as empty regions. If the given image does

manpages/setxkbmap.1.html
setxkbmap(1) - set the keyboard using the X Keyboard Extensi
The setxkbmap command maps the keyboard to use the layout determined by the options specified on the command line. An XKB keymap is constructed from a number of

manpages/asn1_read_value_type.3.html
asn1_read_value_type(3) API function - Linux manual page....
Returns the type and value of one element inside a structure. If an element is OPTIONAL and this returns ASN1_ELEMENT_NOT_FOUND, it means that this element wasn





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