operations invert order of variable contents (= glob issues)
Posted: Tue Jul 15, 2014 8:24 am
`add_var_object` moves the var_object pointer the new element was added to to point to the new end of the list, and set operations walk the lists backwards, this causes the order to be inverted on each operation, causing globs to get messed up.
Consider:
The /fails subject will error with
gradm version 3.0.201405281853
Consider:
- Code: Select all
define a {
/dir
/dir/foo* r
/dir/f* rw
}
define b {
/dummy
}
subject /works {
$a | $b | $b
}
subject /fails {
$a | $b
}
The /fails subject will error with
- Code: Select all
Error on line 2517 of /etc/grsec/policy: Globbed object /dir/foo* in subject /fails is completely matched by previous globbed object /dir/f*. As globbed objects with the same anchor are matched on a first-rule-matches-first policy, the ordering present in your policy likely does not reflect your intentions.
gradm version 3.0.201405281853