Skip to content

Commit

Permalink
remove backslash from 'header' column when short line
Browse files Browse the repository at this point in the history
  • Loading branch information
iko1 committed Jan 8, 2022
1 parent 2fb0ab1 commit e2cdc6a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions osquery/tables/system/posix/sudoers.cpp
Expand Up @@ -63,11 +63,17 @@ void genSudoersFile(const std::string& filename,
}

// if last line contains a backslash as the last character,
// treat current line as part of long line.
// treat current line as part of previous line and
// append it to appropriate column.
if (isLongLine) {
isLongLine = (line.at(line.size() - 1) == '\\');
results.back()["rule_details"].pop_back();
results.back()["rule_details"].append(line);
if (results.back()["rule_details"].empty()) {
results.back()["header"].pop_back();
results.back()["rule_details"].append(line);
} else {
results.back()["rule_details"].pop_back();
results.back()["rule_details"].append(line);
}
continue;
}

Expand Down

0 comments on commit e2cdc6a

Please sign in to comment.