cap_task_fix_setuid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cap_task_fix_setuid(9)

okay so bestie, welcome to the Kernel API Manual, section 9 β€” pull up a chair, we're talking about cap_task_fix_setuid, and honestly? it's giving "tiny function, big responsibilities." πŸŽ€


✨ NAME ✨

cap_task_fix_setuid β€” the little guy that fixes up the results of a setuid() call 🫢


🌸 SYNOPSIS 🌸

int cap_task_fix_setuid (struct cred *new , const struct cred *old , int flags );

like, that's the whole signature, and yes it returns an int, we'll get to that πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • new β€” the proposed credentials πŸ‘‘ like, the outfit your task wants to wear
  • old β€” the current task's current credentials 🌈 the outfit it's wearing right now
  • flags β€” indications of what has changed πŸ•΅οΈβ€β™€οΈ a lil heads-up about what's different

πŸ’œ DESCRIPTION πŸ’œ

so what does it do? it fixes up the results of the setuid call before the credential changes are actually applied ✨ like a bouncer checking your fit before you get into the club, no cap.

that's it. that's the vibe. it does the fix-up first, then the credential changes go through. periodt πŸ’…


πŸ”₯ RETURN πŸ”₯

  • 0 β€” grant the changes βœ… slay, you're in
  • -ve β€” deny them πŸ’€ (negative value, i.e. the vibe check failed)

🌟 SEE ALSO 🌟

the whole friend group, fr fr β€” and the kernel file ./security/commoncap.c πŸ“:


πŸ’‘ reminder bestie: every single one of those is a real page, go read them, iykyk πŸ“š

okay that's the whole thing, mwah πŸ’‹ β€” this page lives in ./security, dated October 2026, and it's brought to you by the Kernel API Manual gang. catch you in the next manpage, bestie πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from