Movatterモバイル変換


[0]ホーム

URL:


man7.org > Linux >man-pages

Linux/UNIX system programming training


keyctl_get_persistent(3) — Linux manual page

NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |LINKING |SEE ALSO |COLOPHON

KEYCTL_G...ERSISTENT(3) Linux Key Management CallsKEYCTL_G...ERSISTENT(3)

NAME        top

       keyctl_get_persistent - get the persistent keyring for a user

SYNOPSIS        top

#include <keyutils.h>long keyctl_get_persistent(uid_tuid, key_serial_tkeyring);

DESCRIPTION        top

keyctl_get_persistent() gets the persistent keyring for the       specified user ID.  Unlike the session and user keyrings, this       keyring will persist once all login sessions have been deleted and       can thus be used to carry authentication tokens for processes that       run without user interaction, such as programs started by cron.       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:              /proc/sys/kernel/keys/persistent_keyring_expiry       (by default three days).  Should the timeout be reached, the       persistent keyring will be removed and everything it pins can then       be garbage collected.       Ifuid is-1then the calling process's real user ID will be used.       Ifuid is not-1then errorEPERMwill 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 haveSetUid       capability.       If successful, a link to the persistent keyring will be added intokeyring.

RETURN VALUE        top

       On successkeyctl_get_persistent() returns the serial number of       the persistent keyring.  On error, the value-1will be returned       anderrno will have been set to an appropriate error.

ERRORS        top

EPERMNot permitted to access the persistent keyring for the              requesteduid.ENOMEMInsufficient memory to create the persistent keyring or to              extendkeyring.ENOKEYkeyring does not exist.EKEYEXPIREDkeyring has expired.EKEYREVOKEDkeyring has been revoked.EDQUOTThe user does not have sufficient quota to extendkeyring.EACCESkeyring exists, but does not grantwritepermission to the              calling process.

LINKING        top

       This is a library function that can be found inlibkeyutils.  When       linking,-lkeyutilsshould be specified to the linker.

SEE ALSO        top

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

COLOPHON        top

       This page is part of thekeyutils (key management utilities)       project.  Information about the project can be found at [unknown       -- if you know, please contact man-pages@man7.org] If you have a       bug report for this manual page, send it to       keyrings@linux-nfs.org.  This page was obtained from the project's       upstream Git repository       ⟨http://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git⟩       on 2025-08-11.  (At that time, the date of the most recent commit       that was found in the repository was 2023-03-20.)  If you discover       any rendering problems in this HTML version of the page, or you       believe there is a better or more up-to-date source for the page,       or you have corrections or improvements to the information in this       COLOPHON (which isnot part of the original manual page), send a       mail to man-pages@man7.orgLinux                          20 Feb 2014KEYCTL_G...ERSISTENT(3)

Pages that refer to this page:KEYCTL_GET_PERSISTENT(2const)keyctl(3)keyrings(7)persistent-keyring(7)



HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface.

For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere.

Hosting byjambit GmbH.

Cover of TLPI


[8]ページ先頭

©2009-2025 Movatter.jp