KEYCTL_INVALIDATE(3)
β¨ KEYCTL_INVALIDATE π
okay bestie, so we're in section 3 of the Linux Key Management Calls manual, and today's main character is keyctl_invalidate β the "you're dead to me" button for keys. no cap. π«Ά
πΈ NAME πΈ
keyctl_invalidate β invalidate a key πβ¨
π SYNOPSIS π
#include <keyutils.h>
long keyctl_invalidate(key_serial_t key);
π DESCRIPTION π
okay so keyctl_invalidate() invalidates a key. and the way it does it is lowkey dramatic: the key gets scheduled for immediate removal from all the keyrings that point to it, and after that it's getting deleted. periodt. ποΈ
and here's the iconic part β the key gets ignored by all searches the second this function is called, even if it hasn't been fully dealt with yet. like, it's ghosted on sight. no waiting around, no "let me think about it". the vibe check is instant. π
but listen, there's a gate: the caller must have search permission on a key to be able to invalidate it. no search permission, no invalidation. that's the rule, i don't make them. π
β RETURN VALUE β
- on success,
keyctl_invalidate()returns0. slay. π - on error, the value
-1gets returned anderrnowill have been set to an appropriate error. π
π₯ ERRORS π₯
ENOKEYβ the key specified is invalid. not a real one, bestie, we can't find it πEKEYEXPIREDβ the key specified has expired. it's giving "expired milk in the fridge" π₯πEKEYREVOKEDβ the key specified had been revoked. somebody already pulled its card π«EACCESβ the key exists, but is not searchable by the calling process. it's there, you just don't have the pass π
π¦ LINKING π¦
this is a library function and it lives in libkeyutils. so when you're linking, -lkeyutils should be specified to the linker. don't forget it or you'll be crying in undefined reference πβ¨
π SEE ALSO π
keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3), keyrings(7), keyutils(7)
and that's the whole page, bestie π this one came straight outta the Linux keyutils world, dated 29 Aug 2013 β yeah she's an elder but she still ate πβ¨ go invalidate something responsibly, ily, bye ππ¦
π¦ 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) 2013 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