visudo + sudoedit = ♥?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reading the visudo and sudoedit entry points and how visudo invokes an editor; the issue does not name source files or tests. Work out how permission checks and syntax validation interact before estimating an implementation. Done means visudo can support editing sudoers files as the invoking user while retaining syntax validation, including a clear response when required permissions are missing.
Written by the indexing model from the issue text.
Description
I'd like a way to edit my sudoers file (or one of its includes) in a way that combines the best of sudoedit and visudo:
- Runs the editor as myself, like
sudoedit - Ensures I got the syntax right, like
visudo
This might be doable today using something like sudo SUDO_EDITOR=my-wrapper visudo, where my-wrapper is a script that copies the given temp file over to a user-writeable one, runs sudoedit on that as SUDO_USER, and copies the modified file back over to original the temp file.
However, I think it would be much nicer if this functionality was available built-in.
In terms of the user interface, I would think it makes most sense to just enhance visudo to detect if it is being run by a user without write access to the given file(s) (i.e. typically a non-root user). If so, rather than invoking the editor directly, it would run sudoedit; perhaps after first checking via sudo -l that the required permissions exist (in order to give a better error message if not).
If this makes sense, I'd be happy to have a go at implementing this.
- Dominant language
- C
- Stars
- 1.7k
- Forks
- 306
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sudo-project/sudo
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sudo-project/sudo#583 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
sudo-project/sudo#581 · 4 comments ·
Maintainers usually reply within 1 day
-
Signal forwarded to the command is lost when it arrives between fork() and execve() of the commandOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sudo-project/sudo#566 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
sudo-project/sudo#553 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
sudo-project/sudo#552 ·
Maintainers usually reply within 1 day
All issues in sudo-project/sudo
Similar issues
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/nuttx-apps#3942 ·
Maintainers usually reply within 1 day
-
Add missing unit tests for IsAdmissionPolicyName and IsCertManagerResourceNamePossibly taken @a1h8 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kubernetes-sigs/security-profiles-operator#3644 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
ly05010419/MacNativeGames#1340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day