Skip to content

Conversation

@squell
Copy link
Member

@squell squell commented Mar 25, 2025

Closes #1044

Also fixes a bug in visudo where it would not consume the newline that was entered in a prompt.

I've also tried to reformat the "redo until the sudoers file is acceptable" loop to make the control flow a little more clear.

Can be reviewed commit-by-commit.

I expect a6ccf9f to be a controversial commit and I can live without it.

@squell squell requested a review from bjorn3 March 25, 2025 20:51
@squell squell force-pushed the prevent-lockout branch 2 times, most recently from 403aa29 to 19c5150 Compare March 25, 2025 22:58
@squell
Copy link
Member Author

squell commented Mar 25, 2025

Example, if you now accidentally remove something important (like say the %sudo ALL= ... line), you'd get:

It looks like you have removed your ability to run 'sudo visudo' again.

What now? e(x)it without saving / (e)dit again / lock me out and (S)ave: 

@squell squell force-pushed the prevent-lockout branch 2 times, most recently from bea39d9 to cb30e76 Compare March 27, 2025 18:21
@squell squell requested a review from rnijveld March 27, 2025 18:22
@squell squell enabled auto-merge March 27, 2025 18:28
@squell squell merged commit c8d958a into main Mar 28, 2025
15 checks passed
@squell squell deleted the prevent-lockout branch March 28, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent accidental lockouts with visudo

3 participants