Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for sudo -e or sudoedit #762

Open
mrnossiom opened this issue Sep 12, 2023 · 3 comments
Open

Support for sudo -e or sudoedit #762

mrnossiom opened this issue Sep 12, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

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
Collaborator

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. 馃槂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants