cap_capget(9)
π cap_capget β kernel API manual, but make it make sense
okay so bestie, welcome to cap_capget(9) from the Kernel API Manual β¨ this one is lowkey a little legend in ./security/commoncap.c and honestly it's giving "quiet little helper that just works". Let's get into it π«Ά
πΈ SYNOPSIS πΈ
int cap_capget (const struct task_struct *target , kernel_cap_t
*effective , kernel_cap_t *inheritable , kernel_cap_t *permitted );
like, that's the whole signature. no cap. returns an int, takes four args, four pointers, one of which is const because we're respectful like that π
π ARGUMENTS π
targetβ the task you're snooping on π the one whose capability sets you wanna retrieve. it's aconst struct task_struct *, so no touching.effectiveβ the place to record the effective set. this is where the answer goes, bestie.inheritableβ the place to record the inheritable set. another output home πpermittedβ the place to record the permitted set. last but literally not least.
all three of those output pointers are kernel_cap_t *, just so we're clear π§
β¨ DESCRIPTION β¨
so what does it do? this function retrieves the capabilities of the nominated task and returns them to the caller. that's it. that's the whole vibe. iconic behaviour honestly π₯
like β you name the task in target, and it hands the capability sets back to you through effective, inheritable and permitted. clean, simple, main character energy π
π¦ SEE ALSO π¦
all of these live in the kernel file ./security/commoncap.c and they're the whole friend group, fr fr:
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_access_check(9)cap_ptrace_traceme(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_fix_setuid(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)
go read them all, iykyk ππ
ngl there are no warnings, no exit statuses, no env vars and no bug notes on this one β it's a chill little getter. don't go inventing drama where there is none π
okay that's the page!! this cutie lives in the ./security directory of the kernel tree, comes from the Kernel API Manual, and the version on record is dated October 2026 π so go forth and retrieve those capability sets, bestie β slay π
β¨
π¦ 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