cap_task_fix_setuid(9)
π 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 wearoldβ the current task's current credentials π the outfit it's wearing right nowflagsβ 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 π:
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_access_check(9)cap_ptrace_traceme(9)cap_capget(9)cap_capset(9)cap_inode_need_killpriv(9)cap_inode_killpriv(9)kuid_root_in_ns(9)rootid_from_xattr(9)cap_convert_nscap(9)get_vfs_caps_from_disk(9)cap_bprm_creds_from_file(9)cap_inode_setxattr(9)cap_inode_removexattr(9)cap_task_setscheduler(9)cap_task_setioprio(9)cap_task_setnice(9)cap_task_prctl(9)cap_vm_enough_memory(9)cap_mmap_addr(9)
π‘ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms