aa_dfa_matchn_until(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aa_dfa_matchn_until(9) β€” like, the kernel API manual, but make it make sense πŸ¦‹

okay so bestie, we're in the Kernel API Manual today and this little icon is called aa_dfa_matchn_until ✨ she lives in AppArmor land and she is so good at her job. let me spill 🫢


🌸 NAME 🌸

aa_dfa_matchn_until β€” traverse @dfa until accept or @n bytes consumed πŸ’«

like, she walks the dfa and she does not stop until she hits an accept or she's eaten @n bytes. main character energy fr fr πŸ‘‘


✨ SYNOPSIS ✨

aa_state_t aa_dfa_matchn_until (const struct aa_dfa *dfa , aa_state_t
start , const char *str , int n , const char **retpos );

here's the whole squad, no cap πŸŽ€


🧚 ARGUMENTS 🧚

  • dfa β€” the dfa to match str against πŸ’– (NOT NULL β€” like, respectfully, she needs to exist, don't do her like that 😭)
  • start β€” the state of the dfa to start matching in 🌈 you're picking up exactly where you left off, iykyk
  • str β€” the string of bytes to match against the dfa 🌸 (NOT NULL again bestie, same energy πŸ’€)
  • n β€” length of the string of bytes to match πŸ“ that's how many bytes we're willing to snack on
  • retpos β€” first character in str after the match OR str + n 🎯 that's the little pointer she hands back to you so you know where she stopped

πŸ’œ DESCRIPTION πŸ’œ

aa_dfa_match_len will match str against the dfa and return the state it finished matching in. πŸ”₯ the final state can be used to look up the accepting label, or as the start state of a continuing match β€” so she's not just a one-hit wonder, she's reusable πŸ’…

This function will happily match again the 0 byte and only finishes when n input is consumed. 🫢 ngl that's the whole vibe: she does not bail at a 0 byte, she keeps going until n bytes are done. periodt. ⭐


πŸ‘‘ RETURN πŸ‘‘

final state reached after input is consumed ✨ that's it, that's the tea πŸ“


πŸŽ€ SEE ALSO πŸŽ€

the rest of the crew, all in Kernel file ./security/apparmor/match.c 🌸:


ok lowkey reminder: dfa and str are both NOT NULL. don't test her. πŸ™ˆ

and that's the page bestie πŸ’– sign-off time: this one's from ./security/apparmor, dated October 2026, and yes it's literally titled aa_dfa_matchn_until(9) β€” iconic, no notes πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from