Compare commits

...
Author SHA1 Message Date
rustdeskandClaude Opus 5.5 3bbe76def1 Say "until authorized" in the permission switch comment
The switch arrives after the login request, so "before login" was
inaccurate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
2026-11-15 08:21:54 +08:00
rustdeskandClaude Opus 5.5 3cbffc4ab2 Subscribe clipboard services from permission switches only after authorization
Permission toggles in the accept window reach the connection before the
peer is authorized. The keyboard, clipboard and file switches subscribed
the clipboard services at once, so anything the host copied while the
window was open was sent to a peer that had not been accepted.

Subscribe only once authorized, as the audio switch does; on
authorization try_sub_monitor_services subscribes from the recorded
values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
2026-11-15 08:10:54 +08:00
+4 -3
View File
@@ -805,7 +805,8 @@ impl Connection {
if &name == "keyboard" {
conn.keyboard = enabled;
conn.send_permission(Permission::Keyboard, enabled).await;
if let Some(s) = conn.server.upgrade() {
// Until authorized, only record the value; try_sub_monitor_services subscribes from it.
if let Some(s) = conn.server.upgrade().filter(|_| conn.authorized) {
s.write().unwrap().subscribe(
super::clipboard_service::NAME,
conn.inner.clone(), conn.can_sub_clipboard_service());
@@ -822,7 +823,7 @@ impl Connection {
} else if &name == "clipboard" {
conn.clipboard = enabled;
conn.send_permission(Permission::Clipboard, enabled).await;
if let Some(s) = conn.server.upgrade() {
if let Some(s) = conn.server.upgrade().filter(|_| conn.authorized) {
s.write().unwrap().subscribe(
super::clipboard_service::NAME,
conn.inner.clone(), conn.can_sub_clipboard_service());
@@ -853,7 +854,7 @@ impl Connection {
conn.try_empty_file_clipboard();
}
#[cfg(feature = "unix-file-copy-paste")]
if let Some(s) = conn.server.upgrade() {
if let Some(s) = conn.server.upgrade().filter(|_| conn.authorized) {
s.write().unwrap().subscribe(
super::clipboard_service::FILE_NAME,
conn.inner.clone(),