Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.ml

16 replies

One thing to note is that sudo-rs is not aiming to be a 1:1 reimplementation.

Foreshadowing some tension...

35

Rare Canonical W. The only thing I miss from the original sudo is sudoedit, but I'm pretty sure that's on the Rust implementation's TODO list.

18
sh.itjust.works

They've got a few months to get it done, and it shouldn't be that hard, no? Just exec EDITOR as a child process, no?

10

Sure. I guess it would depend on how complex that is, but surely the sudo command already does validations, so it would just need to have the editor write to a temporary file (which is a copy of the official one) and write once it's validated, right?

It sounds doable in a few months.

5
lemmy.blahaj.zone

I don't think it's that simple. The challenge is that you need to still behave as if it's invoked as the user so that the editor uses their configurations instead of simply execing it as root.

I could be wrong though ¯\_(ツ)_/¯

7
sh.itjust.works

Sudo uses the setuid bit or whatever, so it still has access to the user's environment variables and whatnot. So figuring out which editor to run shouldn't be an issue.

2

That's not what I mean. Yeah, getting the environment variables are simple enough, but if you simply exec something as the root user, whatever you exec will naturally be looking for configs in /root/.config and not your ~/.config dir, so any configurations to things like your text editor won't be read.

6

Ah, makes sense. It's easy enough to duplicate the outer ENV for the sub-process, but I don't know what that means for security and whatnot.

2

Yep. They make some strange decisions sometimes but this isn't one of them.

3
pawb.social

Time for people to be mad that sudo-rs isn't GPL even though the original sudo wasn't GPL either.

16

You reached the end

Ubuntu 25.10 Switches to Rust-based Sudo | Spyke