We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d437fdc commit 031bbddCopy full SHA for 031bbdd
src/sudoers/tokens.rs
@@ -185,7 +185,13 @@ impl Token for Command {
185
// if no arguments are mentioned, anything is allowed
186
None
187
} else {
188
- if args.last().map(|x| -> &str { x }) == Some("\"\"") {
+ if args.first().is_some_and(|x| x.starts_with('^')) {
189
+ // regular expressions are not supported, give an error message. If there is only a
190
+ // terminating '$', this is not treated as a malformed regex by millersudo, so we
191
+ // can ignore that.
192
+ return Err("regular expressions in sudoers rules are not supported".to_string());
193
+ }
194
+ if args.last().is_some_and(|x| x == "\"\"") {
195
// if the magic "" appears, no (further) arguments are allowed
196
args.pop();
197
}
0 commit comments