mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-04 03:49:25 +08:00
preserve sudo env; required for WAYLAND_DISPLAY
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
7ac49287df
commit
0f307e7ca2
@ -591,10 +591,8 @@ where
|
||||
let xdg = &format!("XDG_RUNTIME_DIR=/run/user/{}", uid) as &str;
|
||||
let mut args = vec![xdg, "-u", &username, cmd.to_str().unwrap_or("")];
|
||||
args.append(&mut arg.clone());
|
||||
// -E required for opensuse
|
||||
if is_opensuse() {
|
||||
// -E is required to preserve env
|
||||
args.insert(0, "-E");
|
||||
}
|
||||
|
||||
let task = Command::new("sudo").envs(envs).args(args).spawn()?;
|
||||
Ok(Some(task))
|
||||
|
Loading…
Reference in New Issue
Block a user