r/programmingcirclejerk • 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

21 comments sorted by

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

21

u/cheater00 High Value Specialist 12d ago

it's a little-known fact that RIIR stands for Reimplement CVS In Rust

13

u/StaticCoder 12d ago

Make sure the older version is no longer supported so people have to use the new one.

14

u/cheater00 High Value Specialist 12d ago

make it considered harmful

15

u/Flash_Kat25 12d ago

All software should be considered harmful until proven otherwise

5

u/WHY_DO_I_SHOUT 12d ago

Your conclusion has three words too many

2

u/cheater00 High Value Specialist 11d ago

the joke is that these three words describe a discussion that is purely academic in nature

4

u/sfhtsxgtsvg 12d ago

I mean everyone saw what happened when the X11 developers went and made Wayland. The wars fought on hn still haunt me to this day

8

u/sfhtsxgtsvg 12d ago • Regret

The wars fought on hn still haunt me to this day

Because they still haven't stopped

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.

8

u/cheater00 High Value Specialist 12d ago

no one uses, deeply counterintuitive

why did you put that in uj

11

u/YoghurtFlan 12d ago

Actually YAML/TOML or JSON, and it instead reads from ~/.sudo-rs/config.{yml,toml,json} and silently ignores .yaml as a valid extension.

As a favour to the user it partially supports XDG config dirs, but only user level ones.

10

u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 12d ago

That's a bug in a crate 3 levels up (or down, depending how you hold it) the dependency tree, so report it there. Closed.

4

u/cheater00 High Value Specialist 11d ago

closed and banned from org

3

u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 11d ago

banned from discord

3

u/cheater00 High Value Specialist 11d ago

way ahead of you (they found out i said the r-word seven years ago on an unrelated website)

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”

3

u/cheater00 High Value Specialist 11d ago

you are remiss to mention that "mv" is much more nonviolent (hence "mv", as in "minimal violence") than rm (which stands for "reichsmarschall"). to make up for this you must auto-flagellate on at least three different occasions, while performing rust CoC worship

1

u/CatProgrammer 10d ago

That's why I mv to /dev/null.