Message boards : Number crunching : Sudo-rs parsing issue
Message board moderation

To post messages, you must log in.

AuthorMessage
Lem Novantotto

Send message
Joined: 24 May 23
Posts: 56
Credit: 5,039,545
RAC: 43,610
Message 52688 - Posted: 22 Nov 2025, 13:04:21 UTC
Last modified: 22 Nov 2025, 13:08:29 UTC

Hi!
People using sudo-rs instead of sudo, as it happens with Ubuntu 25.10, will likely find an issue with the file /etc/sudoers.d/50-lhcathome_boinc_theory_native.
In this file the dot happens to be escaped: "\.", whereas sudo-rs parsing doesn't want it (at least with my version 0.2.8). You can delete the "\", leaving the dot alone in every occurence. You can use visudo to edit the file:
sudo visudo -f /etc/sudoers.d/50-lhcathome_boinc_theory_native

Then double-check with:
sudo visudo -c

--
Bye, Lem
ID: 52688 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2702
Credit: 290,598,609
RAC: 140,583
Message 52690 - Posted: 23 Nov 2025, 10:26:39 UTC - in response to Message 52688.  

The sudoers file uses regular expressions like here:
Cmnd_Alias LHCATHOMEBOINC_02 = /usr/bin/systemctl ^(freeze|thaw) Theory_[-a-zA-Z0-9_]+\.scope$

In general, if a regex contains a '.' this stands for 'any character'.
If you want to restrict it literally to a '.' then you must escape it with a '\'.

If sudo-rs rejects a regex containing a valid escape like above then this is a bug in sudo-rs.
Hence, please send a bug report to the sudo-rs developers:
https://github.com/trifectatechfoundation/sudo-rs
ID: 52690 · Report as offensive     Reply Quote
Lem Novantotto

Send message
Joined: 24 May 23
Posts: 56
Credit: 5,039,545
RAC: 43,610
Message 52691 - Posted: 23 Nov 2025, 13:21:49 UTC - in response to Message 52690.  

If sudo-rs rejects a regex containing a valid escape like above then this is a bug in sudo-rs.


I don't think so. sudo-rs does not support wildcards in command arguments, so no need for dots to be escaped. A dot is always a dot with sudo-rs.
There had been a bug with the equal sign (=) not escapable, fixed already.
Sudo-rs and sudo are not 100% compatible. Just it.

However, if someone doesn't like sudo-rs, he can install and use sudo instead.
--
Bye, Lem
ID: 52691 · Report as offensive     Reply Quote
computezrmle
Volunteer moderator
Volunteer developer
Volunteer tester
Help desk expert
Avatar

Send message
Joined: 15 Jun 08
Posts: 2702
Credit: 290,598,609
RAC: 140,583
Message 52693 - Posted: 23 Nov 2025, 17:26:20 UTC - in response to Message 52691.  

I do not agree.

We use sudo's regex support for very good reasons.

Your small modification shows that sudo-rs supports regex at least partly.
So, why not completely?
Escaping a '.' is not a wildcard issue.
Not supporting it is a clear bug or forgotten feature.

Sudo-rs is rather new and claims to be a replacement for sudo.
The example here and other discussions at their development site shows it is far away from being ready.
ID: 52693 · Report as offensive     Reply Quote

Message boards : Number crunching : Sudo-rs parsing issue


©2025 CERN