trifectatechfoundation / sudo-rs

A memory safe implementation of sudo and su.
Other
2.88k stars 77 forks source link

Produce an error if `*` is encountered in a argument position. #780

Open squell opened 12 months ago

squell commented 12 months ago

We explicitly do not support wildcards as arguments (see the current README). I.e. rm *.txt will only match a literal sudo rm '*.txt', which is quite useless. This issue proposes it becomes an actual error.

squell commented 12 months ago

Note, closing this issue by merging the PR has the ability to break systems. E.g. suppose a sudoers rule has %sudoers ALL = (ALL:ALL) ALL, NOPASSWD: /bin/ls -la *, that entire rule will be rejected, and someone might get bricked, whereas currently they simply won't be able to use ls -la without typing in their password.

An alternative is to close this issue (and close the PR without merging) and see this as a subset of issue #53; which would involve writing a secondary "analysis" phase of the entire AST where we ferret out infelicities that are not fatal, but not recommended. (That would have my preference)