AUPARSE_INIT(3)
π AUPARSE_INIT(3) β Linux Audit API π
okay bestie, gather round, because this one is the starting point of the whole audit-parsing saga. This is the manual page for auparse_init, from the Linux Audit API section 3, and yes, it's the one you call first before literally anything else works. β¨
β¨ NAME β¨
auparse_init β initialize an instance of the audit parsing library π
πΈ SYNOPSIS πΈ
#include <auparse.h>
auparse_state_t * auparse_init(ausource_tsource,constvoid*"b);"
(yeah that's literally how it's written in the source page, we do not editorialize, we copy exactly π )
π¦ DESCRIPTION π¦
auparse_init initializes an instance of the audit parsing library. That's it, that's the whole job, and it's iconic for it.
The function returns an opaque pointer to the parser's internal state. You then hand that pointer into subsequent calls to the library, so keep it somewhere safe, bestie β losing it is giving "lost my keys at 3am" energy π.
The source variable decides where the library looks for data. Legal values can be:
AUSOURCE_LOGSβ use audit logs πAUSOURCE_FILEβ use a file πAUSOURCE_FILE_ARRAYβ use several files ποΈAUSOURCE_BUFFERβ use a buffer π§ΊAUSOURCE_BUFFER_ARRAYβ use an array of buffers π§Ίπ§ΊAUSOURCE_DESCRIPTORβ use a particular descriptor πAUSOURCE_FILE_POINTERβ use a stdioFILEpointer ποΈAUSOURCE_FEEDβ feed data to parser withauparse_feed()π
The pointer b is used to set the file name, array of filenames, the buffer address, or an array of pointers to buffers, or the descriptor number β depending on what source you gave it. So like, b is doing a lot of jobs, it's the main character fr fr π.
When the data source is an array of files or buffers, you would create an array of pointers with the last one being a NULL pointer. That NULL is your little "and that's the end bestie" flag. π
Buffers should be NUL terminated. no cap, do not skip this one.
The data structure returned by auparse_init is not thread-safe. If you need to use it in a multithreaded program, you will need to add locking around any use of the data structure. That's not a suggestion, that's the vibe check, and it will not pass without locks π
β RETURN VALUE β
Returns a NULL pointer if an error occurs; otherwise, the return value is an opaque pointer to the parser's internal state. So: NULL = bad news π, anything else = slay, you're in business π
π SEE ALSO π
π AUTHOR π
Steve Grubb π
Red Hat, Jan 2023 β and that's the whole page, bestie! go forth, init your parser, and remember: no locks, no peace π«Άπβ¨
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit-libs-devel 4.2.1-3.el10 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- ubuntu resolute: libauparse-dev 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: libauparse-dev 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libauparse-dev 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms