Skip to content

Commit b2943c0

Browse files
committed
allow space between Defaults@ and hostname list
1 parent e284d7b commit b2943c0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/sudoers/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ fn get_directive<'a>(
670670
// Backtrack and start parsing following the '@' sign
671671
*stream = begin_state;
672672
stream.advance(DEFAULTS_LEN + 1);
673+
skip_trailing_whitespace(stream)?;
673674

674675
ConfigScope::Host(expect_nonterminal(stream)?)
675676
} else if is_syntax(':', stream)? {

src/sudoers/basic_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl Parse for Comment {
144144
}
145145
}
146146

147-
fn skip_trailing_whitespace(stream: &mut CharStream) -> Parsed<()> {
147+
pub fn skip_trailing_whitespace(stream: &mut CharStream) -> Parsed<()> {
148148
TrailingWhitespace::parse(stream)?;
149149
make(())
150150
}

0 commit comments

Comments
 (0)