KEYCTL_JO...ON_KEYRING(3)
π KEYCTL_JOIN_SESSION_KEYRING β from the Linux Key Management Calls girlies π
okay so bestie, welcome to keyctl_join_session_keyring(3), a page that lives in the Linux Key Management Calls section of your friendly neighbourhood manual. yes the header up top got a lil truncated (KEYCTL_JO...ON_KEYRING(3)) because man pages are dramatic like that, but we know who she is. π
β¨ NAME β¨
keyctl_join_session_keyring β literally just: go join a different session keyring. that's the whole job. she's a switcher. π
β¨ SYNOPSIS β¨
#include <keyutils.h>
key_serial_t keyctl_join_session_keyring(const char *name);
one include, one function, one const char *. we love a minimal icon. πΈ
β¨ DESCRIPTION β¨
okay so here's the tea π« β keyctl_join_session_keyring() changes the session keyring that a process is subscribed to. like, it's moving your process into a new group chat. no cap.
now, the vibe of what happens depends entirely on what you pass in as name:
- if
nameisNULL? a brand new anonymous keyring gets created, and the process gets subscribed to that one. no name, no drama, just a fresh little mystery keyring. β¨ - if
namepoints to a string? then:- if a keyring with that name is already available, the process will attempt to subscribe to it β and if that's not permitted, it's an error, periodt. π
- otherwise, a new keyring of that name gets created and attached as the session keyring. glow up achieved. π
important bestie: to attach to an extant named keyring, that keyring must have search permission available to the calling process. no search perms, no entry. it's giving velvet rope. π«
β¨ RETURN VALUE β¨
- on success? she returns the serial number of the key she found or created. π₯
- on error? you get
-1, anderrnohas been set to an appropriate error. classic.
β¨ ERRORS β¨
here's the mood board of ways this can go wrong:
ENOMEMβ not enough memory to create a key. she's running on fumes. πEDQUOTβ creating this key, or linking it to the keyring, would blow past the key quota for this user. budget said no. πEACCESβ the named keyring exists, but the calling process can't search it. you're outside. looking in. π
β¨ LINKING β¨
this is a library function and she lives in libkeyutils. when you're linking, you gotta hand the linker -lkeyutils. don't forget her, she'll ghost you. π¦
β¨ SEE ALSO β¨
go read these next, they're all in the same friend group π«Ά:
keyctl(1)add_key(2)keyctl(2)request_key(2)keyctl(3)keyrings(7)keyutils(7)session-keyring(7)user-session-keyring(7)
and that's the whole page bestie, you ate that π β¨
this lil masterpiece came from Linux, dated 20 Feb 2014, and she answers to the name KEYCTL_JO...ON_KEYRING(3). mwah, go join a keyring. ππ
π¦ 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) 2006 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