Public bug reported:

sudo-rs does not accept a '=' in command definition or alias, like
`Cmd_Alias FOO_CMD = /bin/foo --bar=1`, but regular sudo accept it.

IMHO sudo-rs should accept '=' characters like sudo.ws does.

Steps to reproduce :

1. Create a sample sudoers file with a command including a '=' character

$ cat /tmp/sudoers << EOF
Cmd_Alias FOO_CMD = /bin/foo --bar=1
%staff ALL = (root) NOPASSWD: FOO_CMD
%users ALL = (root) NOPASSWD: /bin/foo --bar=2
EOF

2. Test the file with regular sudo

$ visudo.ws -c -f /tmp/sudoers
/tmp/sudoers: parsed OK

3. Test the file with sudo-rs

$ visudo-rs -c -f /tmp/sudoers
/tmp/sudoers:1:35: syntax error: garbage at end of line
Cmd_Alias FOO_CMD = /bin/foo --bar=1
                                  ^
/tmp/sudoers:3:45: syntax error: garbage at end of line
%users ALL = (root) NOPASSWD: /bin/foo --bar=2
                                            ^
visudo: invalid sudoers file

Tested on Ubuntu 25.10 with sudo-rs version 0.2.8-1ubuntu2

 lsb_release -rd
Description:    Ubuntu Questing Quokka (development branch)
Release:        25.10

$ apt-cache policy sudo sudo-rs
sudo:
  Installed: 1.9.16p2-3ubuntu2
  Candidate: 1.9.16p2-3ubuntu2
  Version table:
 *** 1.9.16p2-3ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu questing/main amd64 Packages
        100 /var/lib/dpkg/status
sudo-rs:
  Installed: 0.2.8-1ubuntu2
  Candidate: 0.2.8-1ubuntu2
  Version table:
 *** 0.2.8-1ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu questing/main amd64 Packages
        100 /var/lib/dpkg/status

** Affects: rust-sudo-rs (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2123859

Title:
  sudo-rs does not accept a '=' in command definition

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-sudo-rs/+bug/2123859/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to