From f89c6686df2006f12318d76bfc39b1845b156adf Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 8 Nov 2026 13:52:56 -0800 Subject: [PATCH] craft-update: keep link addresses out of the opener's warnings The warnings that open_url_with_fallback and the system opener log no longer include the address being opened, so a link carrying a token or personal details does not reach the application's log. The reasons from the system stay in the messages. --- crates/update/src/process.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/update/src/process.rs b/crates/update/src/process.rs index 23656b9f..e39eb378 100644 --- a/crates/update/src/process.rs +++ b/crates/update/src/process.rs @@ -283,12 +283,12 @@ pub fn open_url_with_fallback(primary_url: &str, fallback_url: &str) { let fallback = fallback_url.to_string(); let opener = std::thread::Builder::new().name("open-url".into()).spawn(move || { if !open_and_wait_success(&primary, Duration::from_millis(1500)) { - log::warn!("couldn't open {primary}; falling back to {fallback}"); + log::warn!("couldn't open a link; opening its fallback"); let _ = open(std::ffi::OsStr::new(&fallback)); } }); if let Err(e) = opener { - log::warn!("couldn't start a thread to open {primary_url} ({e})"); + log::warn!("couldn't start a thread to open a link ({e})"); } } @@ -304,7 +304,7 @@ fn open_and_wait_success(target: &str, timeout: Duration) -> bool { let mut cmd = match opener(std::ffi::OsStr::new(target)) { Ok(cmd) => cmd, Err(error) => { - log::warn!("couldn't resolve the system opener for {target}: {error}"); + log::warn!("couldn't resolve the system opener: {error}"); return false; } }; @@ -314,7 +314,7 @@ fn open_and_wait_success(target: &str, timeout: Duration) -> bool { let mut child = match cmd.stdin(Stdio::null()).stdout(Stdio::null()).stderr(Stdio::null()).spawn() { Ok(c) => c, Err(e) => { - log::warn!("couldn't start the opener for {target}: {e}"); + log::warn!("couldn't start the system opener: {e}"); return false; } };