sudo-rs
sudo-rs copied to clipboard
Stray escape sequence
trafficstars
I get this complaint from sudo-rs and not sudo:
/etc/sudoers.d/lx-srv-admins:1:14: stray escape sequence
%MYCOMPANY.COM\\lx-srv-admins ALL=(ALL) NOPASSWD: ALL
I didn't write that file but based on other comments on the internet it seems legal to have \\ or other backslashes in that file. sudo-rs only allows \n:
// line continuations
if accept_if(|c| c == '\\', stream).is_some() {
// do the equivalent of expect_syntax('\n', stream)?, without recursion
if accept_if(|c| c == '\n', stream).is_none() {
unrecoverable!(stream, "stray escape sequence")
}
Your analysis is correct; and this is related to issue #17 (the resolution of that would also close this issue, but I'd prefer to keep this open as it gives a demonstration of a use case); in Todd Miller's sudo you can probably also write
"%MYCOMPANY.COM\lx-srv-admins" ALL=(ALL) NOPASSWD: ALL but not (yet) in sudo-rs.