mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-21 17:34:42 +03:00
Compare commits
1 Commits
master
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d8a0ebe19 |
Submodule libs/hbb_common updated: 7e1c392c62...5438d20225
@@ -667,8 +667,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// An empty --id (e.g. an unset var) would deploy a blank id; the Android flow guards this too (#15146).
|
let new_id = get_value("--id");
|
||||||
let new_id = get_value("--id").filter(|s| !s.is_empty());
|
|
||||||
match crate::ui_interface::deploy_device(token, new_id) {
|
match crate::ui_interface::deploy_device(token, new_id) {
|
||||||
crate::ui_interface::DeployResult::Ok => {
|
crate::ui_interface::DeployResult::Ok => {
|
||||||
println!("Device deployed.");
|
println!("Device deployed.");
|
||||||
|
|||||||
17
src/ipc.rs
17
src/ipc.rs
@@ -881,14 +881,8 @@ async fn handle(data: Data, stream: &mut Connection) {
|
|||||||
Some(value) => {
|
Some(value) => {
|
||||||
let mut updated = true;
|
let mut updated = true;
|
||||||
if name == "id" {
|
if name == "id" {
|
||||||
// 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_key_confirmed(false);
|
||||||
Config::set_id(&value);
|
Config::set_id(&value);
|
||||||
}
|
|
||||||
} else if name == "temporary-password" {
|
} else if name == "temporary-password" {
|
||||||
password::update_temporary_password();
|
password::update_temporary_password();
|
||||||
} else if name == "permanent-password" {
|
} else if name == "permanent-password" {
|
||||||
@@ -1695,12 +1689,7 @@ pub fn clear_trusted_devices() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_id() -> String {
|
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") {
|
if let Ok(Some(v)) = get_config("id") {
|
||||||
if !v.is_empty() {
|
|
||||||
// update salt also, so that next time reinstallation not causing first-time auto-login failure
|
// update salt also, so that next time reinstallation not causing first-time auto-login failure
|
||||||
if let Ok(Some(v2)) = get_config("salt") {
|
if let Ok(Some(v2)) = get_config("salt") {
|
||||||
Config::set_salt(&v2);
|
Config::set_salt(&v2);
|
||||||
@@ -1709,10 +1698,10 @@ pub fn get_id() -> String {
|
|||||||
Config::set_key_confirmed(false);
|
Config::set_key_confirmed(false);
|
||||||
Config::set_id(&v);
|
Config::set_id(&v);
|
||||||
}
|
}
|
||||||
return v;
|
v
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
Config::get_id()
|
Config::get_id()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_rendezvous_server(ms_timeout: u64) -> (String, Vec<String>) {
|
pub async fn get_rendezvous_server(ms_timeout: u64) -> (String, Vec<String>) {
|
||||||
|
|||||||
@@ -646,16 +646,6 @@ fn try_start_server_(desktop: Option<&Desktop>) -> ResultType<Option<Child>> {
|
|||||||
if !desktop.dbus.is_empty() {
|
if !desktop.dbus.is_empty() {
|
||||||
envs.push(("DBUS_SESSION_BUS_ADDRESS", desktop.dbus.clone()));
|
envs.push(("DBUS_SESSION_BUS_ADDRESS", desktop.dbus.clone()));
|
||||||
}
|
}
|
||||||
if let Ok(forced_display_server) =
|
|
||||||
std::env::var("RUSTDESK_FORCED_DISPLAY_SERVER")
|
|
||||||
{
|
|
||||||
if !forced_display_server.is_empty() {
|
|
||||||
envs.push((
|
|
||||||
"RUSTDESK_FORCED_DISPLAY_SERVER",
|
|
||||||
forced_display_server,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
envs.push((
|
envs.push((
|
||||||
"TERM",
|
"TERM",
|
||||||
get_cur_term(&desktop.uid).unwrap_or_else(|| suggest_best_term()),
|
get_cur_term(&desktop.uid).unwrap_or_else(|| suggest_best_term()),
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ extern "C" bool MacCheckAdminAuthorization() {
|
|||||||
|
|
||||||
// https://gist.github.com/briankc/025415e25900750f402235dbf1b74e42
|
// https://gist.github.com/briankc/025415e25900750f402235dbf1b74e42
|
||||||
extern "C" float BackingScaleFactor(uint32_t display) {
|
extern "C" float BackingScaleFactor(uint32_t display) {
|
||||||
@autoreleasepool {
|
|
||||||
NSArray<NSScreen *> *screens = [NSScreen screens];
|
NSArray<NSScreen *> *screens = [NSScreen screens];
|
||||||
for (NSScreen *screen in screens) {
|
for (NSScreen *screen in screens) {
|
||||||
NSDictionary *deviceDescription = [screen deviceDescription];
|
NSDictionary *deviceDescription = [screen deviceDescription];
|
||||||
@@ -129,7 +128,6 @@ extern "C" float BackingScaleFactor(uint32_t display) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c
|
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c
|
||||||
|
|||||||
Reference in New Issue
Block a user