AUDIT_NAME_TO_FLAG(3)

πŸ’– AUDIT_NAME_TO_FLAG(3) πŸ’–

okay bestie so we're deep in the Linux Audit API today and this one is literally a little translator function, no cap. it's audit_name_to_flag, and it's giving "name goes in, number comes out" energy. πŸ¦‹


✨ NAME ✨

audit_name_to_flag β€” converts the rule-matching filter name into the numeric rule-matching filter value. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <libaudit.h>

int audit_name_to_flag(const char *flag);

πŸŽ€ DESCRIPTION πŸŽ€

so like, audit_name_to_flag() takes a rule-matching filter name and turns it into the matching numeric rule-matching filter value. glow-up but make it integers ✨

the names it recognizes, and their numeric besties, are:

  • "task" β†’ AUDIT_FILTER_TASK
  • "exit" β†’ AUDIT_FILTER_EXIT
  • "user" β†’ AUDIT_FILTER_USER
  • "exclude" β†’ AUDIT_FILTER_EXCLUDE
  • "filesystem" β†’ AUDIT_FILTER_FS

and flag is, you guessed it, the rule-matching filter name you're passing in. 🫢


πŸ‘‘ RETURN VALUE πŸ‘‘

  • if something goes wrong, she returns -1 😭
  • otherwise? you get back the numeric rule-matching filter value. slay. ⭐

πŸ”₯ SEE ALSO πŸ”₯


πŸ’œ AUTHOR πŸ’œ

Steve Grubb β€” king behavior, we stan πŸ‘‘


okay that's the whole page bestie, mwah πŸ’‹ this lil icon came from Red Hat, Mar 2022, and honestly? timeless. periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from