Skip to content

Use more expressive error messages when failing out in visudo #1157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

sohomdatta1
Copy link
Contributor

Old error message:

visudo: Permission denied (os error 13)

Newer error message:

visudo: Failed to open existing sudoers file at "/etc/sudoers": Permission denied (os error 13)

(etc)

Old error message:
```
visudo: Permission denied (os error 13)
```

Newer error message:
```
visudo: Failed to open existing sudoers file at "/etc/sudoers": Permission denied (os error 13)
```

(etc)

Signed-off-by: Sohom <[email protected]>
@sohomdatta1
Copy link
Contributor Author

sohomdatta1 commented Jun 11, 2025

Retroactively filling this out since Github didn't freakin prompt me :(

Pull Request Checklist

(#835 was the closest I could find, but I also assumed that this would be considered a small change under the Contributing guidelines)

@squell
Copy link
Member

squell commented Jun 12, 2025

#835 is the relevant issue---improving the error message you quoted was the prime objective.

To fully close #835 we might want to look at error messages in case PAM is misconfigured (e.g. no PAM profile can be loaded due to a missing /etc/pam.d/sudo and no 'default')

note: We currently don't use PR templates; it's appreciated that you took the time to use the checklist, but it's not a hard requirement on this repository. I have some reservations about forcing people to "tick boxes". For example, the 'code of conduct' is not a "contract" you have to "accept", it's simply something we expect. Some of the other things are checked in CI or code review.

@squell
Copy link
Member

squell commented Jun 12, 2025

Thanks for your contribution!

@squell squell merged commit 5edb66d into trifectatechfoundation:main Jun 12, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants