KEYCTL_RESTRICT_KEYRING
restrict keys that may be linked to a keyring
- Provided by: manpages-dev (Version: 6.17-1)
- Source: manpages
- Report a bug
restrict keys that may be linked to a keyring
Standard C library (libc, -lc)
#include <linux/keyctl.h> /* Definition of KEY* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h>
long syscall(SYS_keyctl, KEYCTL_RESTRICT_KEYRING, key_serial_t keyring,
const char *_Nullable type, const char *restriction);
Apply a key-linking restriction to the keyring with the ID provided in keyring. The caller must have setattr permission on the key. If type is NULL, any attempt to add a key to the keyring is blocked; otherwise it contains a pointer to a string with a key type name and restriction contains a pointer to string that describes the type-specific restriction. As of Linux 4.12, only the type "asymmetric" has restrictions defined:
Note that a restriction can be configured only once for the specified keyring; once a restriction is set, it can't be overridden.
On success, 0 is returned.
On error, -1 is returned, and errno is set to indicate the error.
A wrapper is provided in the libkeyutils library: keyctl_restrict_keyring(3).
Linux.
Linux 4.12.