__lookup_replace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so we're in the Kernel API Manual, and today's main character is __lookup_replace(9) πŸ’…βœ¨. She's here to look up replacement info for a profile, and honestly? iconic.

πŸŽ€ NAME πŸŽ€

__lookup_replace β€” lookup replacement information for a profile. That's the whole gig, bestie. πŸ¦‹

✨ SYNOPSIS ✨

The signature is giving β€œkernel function with a whole lot of pointers”, and not me keeping it exactly as-is, fr fr:

       int __lookup_replace (struct aa_ns *ns , const char *hname , bool
       noreplace , struct aa_profile **p , const char **info );

πŸ’– ARGUMENTS πŸ’–

okay so the friend group here is:

  • ns β€” namespace the lookup occurs in. Like, where the whole thing is happening πŸ’«
  • hname β€” name of profile to lookup. yes, the profile name, bestie.
  • noreplace β€” true if not replacing an existing profile. lowkey important vibe check.
  • p β€” Returns - profile to be replaced. that's the output pointer, periodt.
  • info β€” Returns - info string on why lookup failed. so if it flops, this tells you why 😭

πŸ”₯ RETURN πŸ”₯

On success: profile to replace (no ref) β€” literally no ref, bestie. Otherwise: ptr error. no cap, that's the return vibe.

🌈 SEE ALSO 🌈

Kernel file ./security/apparmor/policy.c β€” and the whole SEE ALSO friend group is right here, no one left out:


Source/version: ./security/apparmor Β· date: October 2026 Β· manual: __lookup_replace(9) β€” k bye bestie, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from