trifectatechfoundation / trifectatechfoundation/sudo-rs

Let `sudoedit` detect every write to the temporary file.

Open
#1,233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-sudoedit suggestion
Dominant language
Rust
Stars
4.5k
Forks
179
Avg merge
16h 45m
Merged PRs (30d)
4

Description

At the moment sudoedit hasn't even been released yet, but trying out the development version I already have a feature request :)

Describe the feature you'd like see implemented in sudo-rs

Intermittent file updates for sudoedit, that is, every time a file is saved, update the 'parent' file. Not just when the editor closes. This would require some changes (perhaps even a few painful ones), but it should be possible with our architecture, e.g. allowing multiple writes to the parent file in the privileged process, and listening to write events in the unprivileged child process.

I think this would be a pretty nice feature enhancement.

What problem can be solved with this feature?
If I'm editing a file with sudoedit, I might want to occassionally hit 'save' and have the updated file on my system without needing to fully close down the editing session.

Additional context
There is one caveat: intermittent saves might happen automatically by some editors, and if users are used to sudoedit only making changes upon "succesful exit" of the editor, that might cause some grief. So we would need to think about this before implementing it. As it might even be a bad idea.

Of course editors that make automatic intermittent saves might already have this same behaviour with existing ogsudoedit, and then this is less of a worry.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the existing sudoedit flow between the unprivileged editor process and the privileged process. Examine how writes are currently detected and when the parent file is updated. Done means repeated saves are handled safely while preserving the expected behavior around editor exit and automatic saves.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.