Created
February 9, 2024 17:11
-
-
Save jrmuizel/f9b2b379986fa63fdece61109f52b93b to your computer and use it in GitHub Desktop.
test.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <bsm/audit.h> | |
#include <bsm/audit_session.h> | |
int main() { | |
auditinfo_addr_t auditInfo; | |
int result = getaudit_addr(&auditInfo, sizeof(auditInfo)); | |
assert(result == 0 ); | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_INITIAL) { | |
printf("AU_SESSION_FLAG_IS_INITIAL\n"); | |
} | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS) { | |
printf("AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS\n"); | |
} | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_TTY) { | |
printf("AU_SESSION_FLAG_HAS_TTY\n"); | |
} | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_REMOTE) { | |
printf("AU_SESSION_FLAG_IS_REMOTE\n"); | |
} | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_CONSOLE_ACCESS) { | |
printf("AU_SESSION_FLAG_HAS_CONSOLE_ACCESS\n"); | |
} | |
if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_AUTHENTICATED) { | |
printf("AU_SESSION_FLAG_HAS_AUTHENTICATED\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment