Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
2d8a0ebe19 Git submodule: bump libs/hbb_common from 7e1c392 to 5438d20
---
updated-dependencies:
- dependency-name: libs/hbb_common
  dependency-version: 5438d2022513573094c860e4035b4fb32a8e7787
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 00:23:27 +00:00
5 changed files with 22 additions and 46 deletions

View File

@@ -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.");

View File

@@ -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). Config::set_key_confirmed(false);
if value.is_empty() { Config::set_id(&value);
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" { } else if name == "temporary-password" {
password::update_temporary_password(); password::update_temporary_password();
} else if name == "permanent-password" { } else if name == "permanent-password" {
@@ -1695,24 +1689,19 @@ 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);
}
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>) { pub async fn get_rendezvous_server(ms_timeout: u64) -> (String, Vec<String>) {

View File

@@ -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()),

View File

@@ -118,18 +118,16 @@ 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]; NSNumber *screenNumber = [deviceDescription objectForKey:@"NSScreenNumber"];
NSNumber *screenNumber = [deviceDescription objectForKey:@"NSScreenNumber"]; CGDirectDisplayID screenDisplayID = [screenNumber unsignedIntValue];
CGDirectDisplayID screenDisplayID = [screenNumber unsignedIntValue]; if (screenDisplayID == display) {
if (screenDisplayID == display) { return [screen backingScaleFactor];
return [screen backingScaleFactor];
}
} }
return 1;
} }
return 1;
} }
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c // https://github.com/jhford/screenresolution/blob/master/cg_utils.c