Skip to content

Support for sudo -e or sudoedit #762

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

Open
mrnossiom opened this issue Sep 12, 2023 · 3 comments · May be fixed by #1121
Open

Support for sudo -e or sudoedit #762

mrnossiom opened this issue Sep 12, 2023 · 3 comments · May be fixed by #1121
Labels
enhancement New feature or request ubuntu
Milestone

Comments

@mrnossiom
Copy link

Hi 👋🏻,

Description

sudo historically has a command to edit a file with the configured editor of your choice, often sudo -e or his own binary sudoedit. It copies the file with your user's permissions in a temporary place so that you can freely edit it.

The -e argument is already defined in the CLI options, so this could be more of a tracking issue.

Whether there should be a sudoedit binary distributed along the others can be discussed here. Since sudo-rs aims to be a fully functional replacement, including a sudoedit binary would help for backwards compatibility. It could also be an opportunity to drop a binary that mirrors the behavior of sudo -e

Additional information

You can see an implementation of such a command here: github.com/sudo-project/sudo:main/src/sudo_edit.c (in C though 🤮)

I'm willing to try a PR for this 😄

@mrnossiom mrnossiom added the enhancement New feature or request label Sep 12, 2023
@japaric
Copy link
Collaborator

japaric commented Sep 19, 2023

Hello!

We discussed this topic in our last weekly meeting and we are happy to accept an external contribution that implements this feature.

We'd like to point out that there's a bit of a quality assurance / control process when landing new features that's not quite formalized (i.e. documented) but that we have been using:

  • write compliance tests for the new feature. I personally like to take a bit of a TDD (Test Driven Development) approach and write the tests first and then write enough code to make the tests pass; then repeat as necessary

  • check original sudo's CVE list to see if there's anything related to the feature. it's good to keep those in mind when writing the code; sometimes the CVE inform about edge cases that may not be obvious

Our CI should catch minor issues like clippy warnings and rustfmt but it's good to run them locally before opening a PR

@squell
Copy link
Member

squell commented Jan 15, 2024

Hi! Any updates on this issue? 😃

@mrnossiom
Copy link
Author

Hi, I'd love to contribute, but I cannot find much energy for this right now. I'd be happy to review or contribute later. I really don't want to block anything, and any progress I'll do we'll be mentioned here. 😃

@squell squell mentioned this issue Nov 26, 2024
@squell squell added this to the Sudoedit milestone May 1, 2025
@squell squell added the ubuntu label May 1, 2025
@mrnossiom mrnossiom linked a pull request May 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ubuntu
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants