Convert Linux process_events mode column to octal (#3800)

This commit is contained in:
Babatunde Micheal Okutubo 2017-10-12 23:02:34 -04:00 committed by Teddy Reed
parent 2b4a46ead5
commit 702203086f

View File

@ -81,7 +81,13 @@ bool ProcessUpdate(size_t type, const AuditFields& fields, AuditFields& r) {
}
if (type == AUDIT_PATH) {
r["mode"] = (fields.count("mode")) ? fields.at("mode") : "";
if (fields.count("mode")) {
std::stringstream ss;
ss << "0" << std::oct << fields.at("mode");
ss >> r["mode"];
} else {
r["mode"] = "";
}
r["owner_uid"] = fields.count("ouid") ? fields.at("ouid") : "0";
r["owner_gid"] = fields.count("ogid") ? fields.at("ogid") : "0";
}