Last active
April 29, 2026 10:06
-
-
Save Alex4386/b7a9311b871786a4c6a61c9951dcdd43 to your computer and use it in GitHub Desktop.
Fix sudo-rs being braindead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set this to 1 once sudo-rs officially supports the passprompt flag | |
| # https://github.com/trifectatechfoundation/sudo-rs/issues/1267 | |
| DOES_SUDO_RS_HAVE_PASSPROMPT_YET=0 | |
| # Paths | |
| SUDOERS_FIX="/etc/sudoers.d/99-rollback-sudo-rs-nonsense" | |
| PROFILE_FIX="/etc/profile.d/99-rollback-sudo-rs-prompt.sh" | |
| if [ "$DOES_SUDO_RS_HAVE_PASSPROMPT_YET" -eq 0 ]; then | |
| echo 'export SUDO_PROMPT="[sudo] password for %u: "' | sudo tee "$PROFILE_FILE" > /dev/null | |
| echo 'Defaults !pwfeedback' | sudo tee "$SUDOERS_FILE" > /dev/null | |
| else | |
| # in case of it being supported: | |
| sudo rm -f "$PROFILE_FILE" | |
| echo 'Defaults !pwfeedback, passprompt="[sudo] password for %u: "' | sudo tee "$SUDOERS_FILE" > /dev/null | |
| fi | |
| echo "Done. You may need to source $PROFILE_ROLLBACK or restart your shell." |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run: