-
Notifications
You must be signed in to change notification settings - Fork 39
Description
System utility commands should never call sudo themselves (unless you've explicitly requested them to, for example, via a command option). For example, if I run mkdir /foo as a normal user, I expect to get a permission denied error, not for mkdir to magically call sudo on my behalf. However, that is what /usr/local/bin/apt does -- it calls sudo on my behalf. This is very unexpected and extremely surprising. Instead, apt should just fail with an error message, if it is run as a user without appropriate privileges.
Imagine my surprise when I ran apt install PACKAGE (instead of sudo apt install PACKAGE) as a normal user and found that it went ahead and installed the package into my root file system! I was shocked and concerned that I might have broken my OS. Luckily, my OS was OK, but I had to spend the next hour trying to figure out how that could have happened.
Please remove the call to sudo from the /usr/local/bin/apt python script. Instead, just let the command fail with the appropriate error message and optionally give a reminder that apt install needs to run with sufficient privileges.