aa_dfa_matchn_until(9)
π 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 matchstragainst π (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, iykykstrβ 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 onretposβ first character instrafter the match ORstr + 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 πΈ:
unpack_table(9)verify_table_headers(9)verify_dfa(9)dfa_free(9)aa_dfa_free_kref(9)remap_data16_to_data32(9)aa_dfa_unpack(9)aa_dfa_match_len(9)aa_dfa_match(9)aa_dfa_next(9)aa_dfa_match_until(9)aa_dfa_leftmatch(9)
ok lowkey reminder:dfaandstrare 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
- 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