Skip to content

Commit

Permalink
Allow skipping commented policy (tiann#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraxp authored and backslashxx committed Dec 7, 2024
1 parent 93b1a1e commit 953a26f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userspace/ksud/src/sepolicy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ where
let mut statements = vec![];

for line in input.split(['\n', ';']) {
if line.trim().is_empty() {
let trimmed_line = line.trim();
if trimmed_line.is_empty() || trimmed_line.starts_with('#') {
continue;
}
if let Ok((_, statement)) = PolicyStatement::parse(line.trim()) {
if let Ok((_, statement)) = PolicyStatement::parse(trimmed_line) {
statements.push(statement);
} else if strict {
bail!("Failed to parse policy statement: {}", line)
Expand Down

0 comments on commit 953a26f

Please sign in to comment.