|KEYCTL_GET_PERSISTENT(3)||Linux Key Management Calls||KEYCTL_GET_PERSISTENT(3)|
#include <keyutils.h> long keyctl_get_persistent(uid_t uid, key_serial_t keyring);
The persistent keyring will be created by the kernel if it does not yet exist. Each time this function is called, the persistent keyring will have its expiration timeout reset to the value in:
(by default three days). Should the timeout be reached, the persistent keyring will be removed and everything it pins can then be garbage collected.
If uid is -1 then the calling process's real user ID will be used. If uid is not -1 then error EPERM will be given if the user ID requested does not match either the caller's real or effective user IDs or if the calling process does not have SetUid capability.
If successful, a link to the persistent keyring will be added into keyring.
- Not permitted to access the persistent keyring for the requested uid.
- Insufficient memory to create the persistent keyring or to extend keyring.
- keyring does not exist.
- keyring has expired.
- keyring has been revoked.
- The user does not have sufficient quota to extend keyring.
- keyring exists, but does not grant write permission to the calling process.
|20 Feb 2014||Linux|