memorysafety / sudo-rs

A memory safe implementation of sudo and su.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `env_editor` and `editor` abstractions to `sudoers/policy.rs`

squell opened this issue · comments

I.e. ideally we should have a function like fn check_editor(path: &Path) -> PathBuf or some such that takes an editor path representing a user preference (e.g. taken from the environment) and returns the editor that the policy has decided for the user.

Alternatively (and perhaps better), we could simply offer a fn editor() -> PathBuf that checks the environment itself (and the env_editor and editor settings) and resolves the editor. CC PR #697