mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-18 05:27:53 +08:00
fix build (#7397)
* fix build Signed-off-by: fufesou <shuanglongchen@yeah.net> * fmt Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
48cd76b938
commit
3d279ec127
@ -25,7 +25,6 @@ use crate::{
|
||||
decrypt_str_or_original, decrypt_vec_or_original, encrypt_str_or_original,
|
||||
encrypt_vec_or_original, symmetric_crypt,
|
||||
},
|
||||
platform::linux::run_cmds,
|
||||
};
|
||||
|
||||
pub const RENDEZVOUS_TIMEOUT: u64 = 12_000;
|
||||
@ -403,10 +402,10 @@ fn patch(path: PathBuf) -> PathBuf {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
if _tmp == "/root" {
|
||||
if let Ok(user) = run_cmds("whoami") {
|
||||
if let Ok(user) = crate::platform::linux::run_cmds("whoami") {
|
||||
if user != "root" {
|
||||
let cmd = format!("getent passwd '{}' | awk -F':' '{{print $6}}'", user);
|
||||
if let Ok(output) = run_cmds(&cmd) {
|
||||
if let Ok(output) = crate::platform::linux::run_cmds(&cmd) {
|
||||
return output.into();
|
||||
}
|
||||
return format!("/home/{user}").into();
|
||||
|
Loading…
Reference in New Issue
Block a user