Files
ports/packages/sudo-rs/patches/0010-sudoers-path.patch
2026-10-29 06:00:54 +00:00

27 lines
682 B
Diff

--- a/src/sudo/mod.rs
+++ b/src/sudo/mod.rs
50,61c50,59
< let mut path = if cfg!(target_os = "freebsd") {
< option_env!("LOCALBASE").unwrap_or("/usr/local").into()
< } else {
< PathBuf::from("/")
< };
< path.push("etc/sudoers-rs");
< if !path.exists() {
< path.set_file_name("sudoers");
< };
<
< dev_info!("Running with {} file", path.display());
< path
---
> let user = PathBuf::from("/var/config/sudo/sudoers");
> if !user.exists() {
> if let Ok(mut path) = std::env::current_exe() {
> path.pop();
> path.pop();
> path.push("share/config/sudoers");
> return path;
> }
> }
> user