KEYCTL_SESSION_TO_PARENT(3)
β¨ KEYCTL_SES..._TO_PARENT(3) β¨
okay so bestie, welcome to the Linux Key Management Calls section of the manual β this is the page for keyctl_session_to_parent, and it's giving "quietly rearranging your whole family's keyring situation" energy π
πΈ NAME πΈ
keyctl_session_to_parent β set the parent process's session keyring, bestie. that's it, that's the whole vibe β¨
π SYNOPSIS π
#include <keyutils.h>
long keyctl_session_to_parent();
no args, no fuss, she just does the thing π«Ά
π DESCRIPTION π
so here's the tea: keyctl_session_to_parent() changes the session keyring to which the calling process's parent subscribes, and makes it be the keyring of the calling process. like, you're handing your own session keyring up to your parent, and the parent is now subscribed to that one. iconic behavior, honestly π
but bestie, there are β¨conditionsβ¨ (there always are):
- the keyring has to have link permission available to the calling process
- the parent process has to have the same UIDs/GIDs as the calling process
- the LSM must not reject the replacement (so if security says no, it's a no, periodt)
also, huge note: this may not be used to affect init or a kernel thread. like, do not. it's not that kind of function π
and one more lil detail that lowkey matters a lot: the replacement will not take immediate effect on the parent process. nope. it's deferred β it happens the next time the parent returns to userspace from kernel space. so it's giving "the change is on its way, she's just running late π¦"</p>
β RETURN VALUE β
- success β
keyctl_session_to_parent()returns0. slay π - error β the value
-1gets returned, anderrnowill have been set to an appropriate error. not slay π
π ERRORS π
ENOMEMβ not enough memory to create a key. she's broke, literally πEPERMβ the credentials of the parent don't match those of the caller. different UIDs/GIDs, different story πEACCESβ the named keyring exists, but the calling process can't link to it. it's there, you just can't touch it π
π LINKING π
this is a library function, bestie β you'll find her hanging out in libkeyutils. when you're linking, you gotta specify -lkeyutils to the linker. don't forget her, she gets lonely π₯Ί
π SEE ALSO π
keyctl(1)add_key(2)keyctl(2)request_key(2)keyctl(3)keyrings(7)keyutils(7)session-keyring(7)user-session-keyring(7)
go read those too, iykyk πβ¨
and that's the whole page, bestie!! π«Ά this one came from Linux, dated 20 Feb 2014 β the manual page for the Linux Key Management Calls, brought to you by the libkeyutils girlies π stay keyed in, drink water, and never, ever try to affect init with this. mwah π
π¦ where this page comes from
- alpine 3.22: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.23: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- alpine 3.24: keyutils-doc 1.6.3-r4 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- arch rolling: keyutils 1.6.3-4 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: keyutils-libs-devel 1.6.3-5.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- centos-stream 9: keyutils-libs-devel 1.6.3-1.el9 Β· GPLv2+ and LGPLv2+
- debian bookworm: libkeyutils-dev 1.6.3-2 Β· GPL-2.0-or-later
- debian trixie: libkeyutils-dev 1.6.3-6 Β· GPL-2.0-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: keyutils-libs-devel 1.6.3-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: keyutils-libs-devel 1.6.3-7.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: keyutils 1.6.3
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: keyutils 1.6.3-160000.3.2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu jammy: libkeyutils-dev 1.6.1-2ubuntu3 Β· GPL-2.0-or-later
- ubuntu noble: libkeyutils-dev 1.6.3-3build1 Β· GPL-2.0-or-later
- ubuntu questing: libkeyutils-dev 1.6.3-6ubuntu2
- ubuntu resolute: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- ubuntu stonking: libkeyutils-dev 1.6.3-6ubuntu3 Β· GPL-2.0-or-later
- Copyright (C) 2010 Red Hat, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms