mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-21 17:34:42 +03:00
fix(ipc): never adopt an empty id from the main IPC (#15626)
This commit is contained in:
25
src/ipc.rs
25
src/ipc.rs
@@ -1689,19 +1689,24 @@ pub fn clear_trusted_devices() {
|
||||
}
|
||||
|
||||
pub fn get_id() -> String {
|
||||
// An empty id may come from a process that took over the main IPC with a
|
||||
// config scope that has no id yet (e.g. a user GUI that became the server
|
||||
// while the installed service was restarting). Treat it as no answer,
|
||||
// otherwise the empty id is adopted below and wipes the local one.
|
||||
if let Ok(Some(v)) = get_config("id") {
|
||||
// update salt also, so that next time reinstallation not causing first-time auto-login failure
|
||||
if let Ok(Some(v2)) = get_config("salt") {
|
||||
Config::set_salt(&v2);
|
||||
if !v.is_empty() {
|
||||
// update salt also, so that next time reinstallation not causing first-time auto-login failure
|
||||
if let Ok(Some(v2)) = get_config("salt") {
|
||||
Config::set_salt(&v2);
|
||||
}
|
||||
if v != Config::get_id() {
|
||||
Config::set_key_confirmed(false);
|
||||
Config::set_id(&v);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
if v != Config::get_id() {
|
||||
Config::set_key_confirmed(false);
|
||||
Config::set_id(&v);
|
||||
}
|
||||
v
|
||||
} else {
|
||||
Config::get_id()
|
||||
}
|
||||
Config::get_id()
|
||||
}
|
||||
|
||||
pub async fn get_rendezvous_server(ms_timeout: u64) -> (String, Vec<String>) {
|
||||
|
||||
Reference in New Issue
Block a user