mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-14 00:11:01 +03:00
fix(deploy): don't wipe local id when --deploy gets an empty --id (#15633)
`rustdesk --deploy --id ""` (e.g. an unset variable in a deployment script) deploys a blank id, then wipes the local id and unconfirms the key through the IPC config write. The Android deploy flow already guards an empty id (#15146); apply the same guard to the CLI, and reject an empty id at the IPC write boundary the same way the read path was fixed in #15626.
This commit is contained in:
10
src/ipc.rs
10
src/ipc.rs
@@ -881,8 +881,14 @@ async fn handle(data: Data, stream: &mut Connection) {
|
||||
Some(value) => {
|
||||
let mut updated = true;
|
||||
if name == "id" {
|
||||
Config::set_key_confirmed(false);
|
||||
Config::set_id(&value);
|
||||
// An empty id would wipe the local id and unconfirm the key (cf. #15626).
|
||||
if value.is_empty() {
|
||||
log::warn!("Ignoring empty id write over IPC");
|
||||
updated = false;
|
||||
} else {
|
||||
Config::set_key_confirmed(false);
|
||||
Config::set_id(&value);
|
||||
}
|
||||
} else if name == "temporary-password" {
|
||||
password::update_temporary_password();
|
||||
} else if name == "permanent-password" {
|
||||
|
||||
Reference in New Issue
Block a user