KEYCTL_UPDATE(3)
π KEYCTL_UPDATE β bestie, let's refresh a key's payload π
okay so this is keyctl_update(3), straight out of the Linux Key Management Calls crew. she lives in the manual, she's iconic, and she's about to tell you how to swap out a key's payload like it's a new outfit. π
β¨ NAME β¨
keyctl_update β update a key π
π¦ SYNOPSIS π¦
#include <keyutils.h>
long keyctl_update(key_serial_t key, const void *payload,
size_t plen);
πΈ DESCRIPTION πΈ
so keyctl_update() does exactly what it says on the tin, no cap: it updates the payload of a key β if the key type permits it. key types are picky like that, and honestly? respect. π
the caller must have write permission on a key to be able to update it. no write perms, no glow-up. periodt.
payload and plen specify the data for the new payload. payload may be NULL and plen may be zero β but only if the key type permits that, so don't get cute. the key type may also just straight up reject the data if it's in the wrong format or invalid in some other way. not me getting rejected by a key type π
π RETURN VALUE π
on success, keyctl_update() returns 0. slay. β¨
on error, the value -1 will be returned and errno will have been set to an appropriate error. so like, check errno, bestie, she's trying to tell you something.
π ERRORS π
ENOKEYβ the key specified is invalid. she doesn't exist. ghosted fr.EKEYEXPIREDβ the key specified has expired. she had her moment, it's over now π₯EKEYREVOKEDβ the key specified had been revoked. taken away, no takebacks πEINVALβ the payload data was invalid. wrong vibe, rejected.ENOMEMβ insufficient memory to store the new payload. no room, the brain is full π§EDQUOTβ the key quota for this user would be exceeded by increasing the size of the key to accommodate the new payload. you hit the limit, bestie, the quota said no πEACCESβ the key exists, but is not writable by the calling process. she's there, she's just not letting you in πEOPNOTSUPPβ the key type does not support the update operation on its keys. this key type simply does not do updates, and that's a her thing π
π LINKING π
this is a library function that can be found in libkeyutils. when linking, -lkeyutils should be specified to the linker. don't forget it, or the linker will be like "who?" π
π SEE ALSO π
keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3), keyrings(7), keyutils(7)
go read them, iykyk π«Ά
Linux Β· 4 May 2006 Β· KEYCTL_UPDATE(3)
and that's the whole page, bestie β written by the Linux keyutils girlies back on 4 May 2006, still serving π mwah, go update something responsibly β¨π
π¦ 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 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