KEYCTL_REVOKE(3)

πŸ“¦
version 1.6.3 Β· 2 versions
  • 1.6.3 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.6.1 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– KEYCTL_REVOKE β€” revoke a key πŸ’–

okay so bestie, welcome to the keyutils corner of the Linux Key Management Calls, and today we're doing KEYCTL_REVOKE(3) β€” the ✨ "actually no, we're done here" ✨ of key management. it's giving main character energy for a function that just... says bye. let's get into it πŸŽ€


✨ NAME ✨

keyctl_revoke β€” revoke a key πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <keyutils.h>

long keyctl_revoke(key_serial_t key);

like, that's it. one include, one function, one key_serial_t. slay 🫢


🌸 DESCRIPTION 🌸

keyctl_revoke() marks a key as being revoked. that's the whole vibe. you're telling the kernel "this key? cancelled. periodt."

After this operation has been performed on a key, attempts to access it will meet with error EKEYREVOKED. so like, it's not gone-gone, it's just... not welcome here anymore πŸ’€

heads up bestie: The caller must have write permission on a key to be able to revoke it. no write perms, no revoke. that's the rules βœ‹

πŸ’œ RETURN VALUE πŸ’œ

On success keyctl_revoke() returns 0. iconique. flawless. no notes.

On error, the value -1 will be returned and errno will have been set to an appropriate error. so always check that errno, fr fr 😭


πŸ”₯ ERRORS πŸ”₯

  • ENOKEY β€” The specified key does not exist. it's not there. never was. you're looking for a ghost πŸ‘»
  • EKEYREVOKED β€” The key has already been revoked. bestie... you already did this. it's already cancelled. no need to double-cancel πŸ’€
  • EACCES β€” The named key exists, but is not writable by the calling process. it's real, it's right there, but it is not letting you touch it πŸ™ˆ

🧚 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 simply not know her 😭


🌈 SEE ALSO 🌈


okay that's the whole page, you ate that 🫢 go forth and revoke responsibly, bestie. this little guide is from the Linux keyutils world, dated 4 May 2006 β€” yeah she's vintage but she still serves πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from