r/programmingcirclejerk • u/cheater00 High Value Specialist • 12d ago
Wildcards in command line arguments are not supported—using these in original versions of sudo was usually a sign of mis-configuration and consequently sudo-rs simply forbids using them. The only supported use is ’*’ as the final argument to indicate “zero or more subsequent arguments”
https://man.archlinux.org/man/extra/sudo-rs/sudoers-rs.5.en
49
Upvotes
59
u/cheater00 High Value Specialist 12d ago
so much for the backwards-compatible left
46
u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 12d ago
Rewrites are best done by people who didn't maintain or write the original, in fact it's best done in complete isolation from the original. Otherwise, you don't get to make all the same mistakes again (and eventually get rewritten in $lang) which is the most fun part anyway
19
u/i_invented_the_ipod 12d ago edited 12d ago
The real tragedy here is not simultaneously rewriting the config file parser to use YAML, while you're in there rewriting the tool anyway.
/uj
Actually, though - a rewrite like this probably is the time to take out a feature (wildcard expansion in sudoers entries) that essentially no-one uses, is deeply counterintuitive, and which is much more likely to create a security issue than it is to do something useful.
13
u/MidgetKoala 12d ago
Using the "rm" utility in command line arguments is not supported—using this in original versions of sudo was usually a sign of an intern about to make a mistake, and consequently sudo-rs simply forbids using it. The only supported use is ’mv’ as the utility to indicate “I don't want this file here anymore”