Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stray escape sequence #836

Open
Timmmm opened this issue Mar 15, 2024 · 1 comment
Open

Stray escape sequence #836

Timmmm opened this issue Mar 15, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@Timmmm
Copy link

Timmmm commented Mar 15, 2024

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")
                }
@Timmmm Timmmm added the bug Something isn't working label Mar 15, 2024
@squell
Copy link
Collaborator

squell commented Mar 15, 2024

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.

@squell squell added this to the Milestone 4 milestone Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants