Skip to content

Commit

Permalink
Fix is_auditd_plugin_enabled() (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
taglines committed Nov 30, 2020
1 parent f34b493 commit de6eeba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auoms.version
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

AUOMS_BUILDVERSION_MAJOR=2
AUOMS_BUILDVERSION_MINOR=3
AUOMS_BUILDVERSION_PATCH=1
AUOMS_BUILDVERSION_PATCH=2
AUOMS_BUILDVERSION_BUILDNR=0
AUOMS_BUILDVERSION_DATE=20201113
AUOMS_BUILDVERSION_STATUS=Developer_Build
17 changes: 14 additions & 3 deletions auomsctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,24 @@ bool is_auditd_plugin_enabled_in_file(const std::string& path) {
}

bool is_auditd_plugin_enabled() {
bool audit_path_exists = PathExists("/etc/audit/plugins.d");
bool audisp_path_exists = PathExists("/etc/audisp/plugins.d");

if (!audit_path_exists && !audisp_path_exists) {
return false;
}

bool audit = false;
if (PathExists("/etc/audit/plugins.d")) {
if (audit_path_exists) {
audit = is_auditd_plugin_enabled_in_file("/etc/audit/plugins.d/auoms.conf");
} else {
audit = true;
}
bool audisp = false;
if (PathExists("/etc/audisp/plugins.d")) {
return is_auditd_plugin_enabled_in_file("/etc/audisp/plugins.d/auoms.conf");
if (audisp_path_exists) {
audisp = is_auditd_plugin_enabled_in_file("/etc/audisp/plugins.d/auoms.conf");
} else {
audisp = true;
}
return audit && audisp;
}
Expand Down

0 comments on commit de6eeba

Please sign in to comment.