Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(linux): gtk sudo shows no false "Sorry, try again." and retries with sudo-rs (#16652)

RustDesk3ec041644d6c
diff --git a/src/platform/gtk_sudo.rs b/src/platform/gtk_sudo.rs
index ccd7d8ace..2ef5f0b82 100644
--- a/src/platform/gtk_sudo.rs
+++ b/src/platform/gtk_sudo.rs
@@ -351,7 +351,10 @@ fn ui_parent(
let last_line = buf.lines().last().unwrap_or(&buf).trim().to_string();
log::info!("read from child: {}", buf);
- if last_line.starts_with("sudo:") || last_line.starts_with("su:") {
+ // sudo-rs's notice for a rejected password, not an error: it asks again.
+ if (last_line.starts_with("sudo:") || last_line.starts_with("su:"))
+ && last_line != "sudo: Authentication failed, try again."
+ {
if let Err(e) = tx_to_ui.send(Message::ErrorDialog(last_line)) {
log::error!("Channel error: {e:?}");
kill_child(child);
@@ -419,6 +422,7 @@ fn ui_parent(
if !last_line.is_empty() && initial_password.is_some() {
log::error!("received not empty line: {last_line}, clear initial password");
initial_password = None;
+ first = true;
}
}
}