Compare commits

...
21 Commits
Author SHA1 Message Date
rustdesk 244a2dc3e6 1.5.4 2026-12-05 12:14:15 +08:00
21pages 2a0056a863 Fix remote ID text being selected when peer suggestions refresh on Flutter 3.44 desktop (#17419)
* fix(flutter): preserve the remote ID caret when peer suggestions refresh

* fix(ci): apply the remote ID selection fix on Flutter 3.44 desktop builds
2026-12-05 11:46:48 +08:00
2378844805 fix(linux): do not start --server while the system is entering sleep (#17373)
* fix(linux): avoid --server respawns on sleep and steady Wayland ticks

Stop Desktop::refresh from re-scanning /proc every 500 ms once an active Wayland user session environment is complete, preserve known non-empty session fields across late-discovery retries on the same session ID, and hold cached session state across brief (<3 s) empty seat0 windows such as VT switches.

Pause start_os_service across org.freedesktop.login1.Manager PrepareForSleep(true/false) while holding a logind delay sleep inhibitor fd, draining or terminating any in-flight --check-hwcodec-config child before releasing the inhibitor so GPU probing does not race kernel suspend entry.

Fixes #17208

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(linux): drop the mock logind test and recheck sleep after refresh

- Remove sleep_monitor_tests. It ran a private dbus-daemon with a mock
  login1 service, and SleepMonitor::with_connection and its dest field
  existed only to point the monitor at it. new() now talks to
  org.freedesktop.login1 directly.
- Keep three helper tests: the steady Wayland environment, the pause
  across sleep, and the --check-hwcodec-config process filter.
- Desktop::refresh() can take seconds. Poll the sleep monitor again
  after it, so a PrepareForSleep that arrived meanwhile stops this
  iteration before it starts --server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(linux): restore a cached XAUTHORITY only for the same DISPLAY

Late Wayland discovery restored each missing field on its own, so a retry
that picked another DISPLAY without an XAUTHORITY got the previous
display's XAUTHORITY. Restore it only when the DISPLAY is unchanged, as
get_display_xauth_xwayland takes a candidate whole. Also rustfmt the new
module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(linux): only hold back the --server start while logind prepares for sleep

Replace the sleep monitor, the delay inhibitor, the hwcodec drain and the
Wayland/seat0 debouncing with one check at the point where the service loop
is about to start --server: if logind reports PreparingForSleep, skip the
start and let the loop retry after wake. The respawn trigger in #17208 is
unknown, but the hazard is only the GPU encoder probe a new --server runs
during suspend entry, and logind holds PreparingForSleep from the sleep
request until the system has resumed.

The diff against master is now 37 added lines in linux.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(linux): recheck PreparingForSleep right before starting --server

should_start_server reads the property before force_stop_server() (a
kill plus 300 ms) and, on the DRM greeter path, before the 1 s grace
that precedes the root fallback. A sleep requested in that gap still got
a --server. Check again in start_server; the skipped start is retried on
the next tick as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:31:40 +08:00
7d95497268 fix(linux): restrict root terminals to the active root desktop (#17395)
* fix(linux): restrict root terminals to the active root desktop

A Linux terminal inherits the server's effective user. Bind a
service-started root server to its selected logind session and grant
a root terminal only while its local graphical desktop is active.
Mark greeter fallbacks explicitly and restart the server when root
switches sessions.

Check the caller's own session for standalone root servers. Localize
the denial and rate-limit logind lookup errors in the host log.

Reported-by: @helixnebulatech@protonmail.com
Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(linux): move terminal session checks into the platform layer

Keep logind session selection, property validation and X11 display matching
together in the Linux platform module. The connection layer issues its
private terminal token only when the platform check succeeds.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): refresh the X11 environment when root logs back in

An empty seat clears the previous session ID while the service retains
the UID. Refresh the display and authority path when the next root
desktop appears so its server inherits the current X11 environment.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): verify root X11 sessions with an empty logind display

GDM on Xorg can leave Display empty on an active graphical login. For
that case, use the kernel credentials of the local X11 socket to check
that its root-owned peer belongs to the selected, active logind session.

Cover the reported GDM session and refusal for a different socket session.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): bind UID 0 desktop aliases and report terminal lookup errors

Use the active desktop UID for privileged server selection and session changes. An explicitly marked greeter cannot issue a root terminal token.

Return the existing localized token error when session verification fails and throttle the Linux denial warning. Each client still receives its own response.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve desktop context for root terminal sessions

Launch UID 0 aliases with their named desktop environment and pass the selected logind session. Restart on session changes even when the UID and display stay the same.

Recognize the explicit local Unix X11 transport. When loginctl exits unsuccessfully, ask logind whether the session has ended so ordinary logout and a system failure get the appropriate client errors.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(linux): simplify terminal session lookup failures

Deny the terminal using the original loginctl failure. A second logind query only distinguished an expired session for the client error message. The X11 peer lookup still verifies the active desktop when Display is empty.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): require logind State=active for a root terminal

Active=yes only says the session holds its seat. When a session logs
out, logind sets it stopping (State=closing) but leaves it as the seat's
active session until another session takes the seat or the session is
finalized (systemd session_stop / session_get_state). A root server
still running in that window would grant a root terminal. Require
State=active, which also implies the session is the seat's active one,
in the loginctl check and for the X11 peer session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:22:15 +08:00
b9328be682 fix: improve close reason delivery during session shutdown (#17279)
* fix(webrtc): deliver the close reason before disconnecting

* fix(kcp): wait for the peer to close after sending a close reason

* fix: release session resources before waiting for peer close

* fix: wait for the peer to close after a login error or privacy-mode notice

A LoginResponse error is often the last message before the connection
closes (login scope change, switch-sides rejection, ID whitelist, privacy
mode on, offline). The PrvOnByOther notice is likewise sent right before
on_close. Over WebRTC or KCP, dropping the stream right after these sends
can discard them, so they now take the same bounded delivery wait as
CloseReason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix: wait only after sends that close, and keep the admission place

24fff979e set sent_close_reason in send_login_error, which also runs for
login errors that keep the connection open (2FA, click-to-accept, wrong
password), on paths that already sleep(1.), and even when the send failed.
Set it from send_before_close instead, on a successful send only, at the
sends that close right after: login scope change, switch-sides rejection,
ID whitelist, privacy mode on, offline, port-forward connect failure and
the PrvOnByOther notice.

Dropping Connection before the wait also released its UnauthorizedID, so
a peer that had not authorized could keep its transport open for up to 1s
outside MAX_UNAUTHORIZED_CONNS. Keep the guard until the wait ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix: wait after the remaining login errors that close the connection

The trusted-device failures (begin, check, enroll), the ID whitelist
rate-limit exit and the Windows terminal OS-login rate-limit block also
close right after sending a login error, so over WebRTC or KCP the error
could still be lost and the controller would reconnect into the limit.

The two rate-limit messages are sent inside check_failure, whose password
and 2FA callers keep the connection open, so the flag is set at the two
callers that close instead.

Rename sent_close_reason to sent_final_message, since it now covers login
errors and the privacy-mode notice as well as CloseReason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix: give up the admission place when evicted during the close wait

A connection waiting for the peer to close still holds its unauthorized
place, and admit_unauthorized refuses new arrivals until an evicted holder
is gone. Race the wait against eviction so the place frees at once.

Also correct the wait's comment for KCP, use Stream::is_webrtc, and give
the WebRTC test the setup timeout hbb_common's loopback tests use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix: wait for the controlled side to close after a manual disconnect over WebRTC

Data::Close sent CloseReason and dropped the stream at once. Over WebRTC
that can discard the queued reason, so the controlled side logs "Reset by
the peer", skips check_remove_session and keeps the session reusable
without a password for SESSION_TIMEOUT. Wait up to one second for the
controlled side to close, as the controlled side now does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* docs: correct why the KCP close wait runs the full second

The controller does send a close on KCP, but it stops its endpoint before
dropping the stream, so the close never leaves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(tcp): wait for the controller to close after a manual disconnect

* log(client): log receipt of the first video frame and close reason

* fix(websocket): wait for the peer after a manual disconnect

* fix: allow ten seconds for TCP and WebSocket manual disconnects

* test(tcp): check close reason delivery during an active upload

* fix(client): release the file clipboard channel before the WebRTC close wait

Reconnect starts the next round without waiting for the old one, and the
next round takes this peer's file clipboard channel from
get_rx_cliprdr_client, which returns the existing one. With the close
wait added for WebRTC in e401af41a, the old round could still be waiting
when the new round set up its clipboard; its cleanup then removed the
shared channel, and file copy and paste stopped working in the
reconnected session. Remove the channel before the wait, so the next
round registers its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(client): save transfer jobs before the WebRTC close wait

Reconnect starts the next round without waiting for this one, and the next
round loads the saved transfer jobs as soon as it logs in. This round saved
them only after its close wait, which can last up to a second, so a fast
reconnect could load stale jobs and not resume an interrupted transfer.
Save them before the wait. The wait discards what arrives, so the jobs do
not change during it, and the save after the round finds nothing new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* log(client): escape the received close reason

The reason is text from the peer. Debug formatting keeps a reason with
line breaks on one log line; the dialog still shows it as sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(client): save transfer jobs once on the WebRTC close path

39dc8f884 saves the jobs before the close wait, but the save after
io_loop still ran once the wait ended. If a newer round saved in between,
that second save wrote this round's jobs back over it, so a transfer the
new round had finished could show up again as unfinished. The wait
discards what arrives, so the second save never had anything new: clear
is_connected after the first one, which makes the exit save a no-op on
this path. Other exit paths save as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkjq1rgjsKR9Xi6WprJ

---------

Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:03:46 +08:00
bovirus 57d312404e Update it.rs (#17416) 2026-12-05 00:11:10 +08:00
Yuri PezzottaandClaude Opus 5.5 5499dafec8 chore(wayland): remove unused imports (#17417)
Drop `tokio` from the hbb_common import in scrap's pipewire.rs and
`allow_err` from src/server/wayland.rs; neither is used in those files.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 00:10:52 +08:00
RustDeskandClaude Opus 5.5 0f65927e91 fix(mobile): move the key bar out of the canvas gesture region (#17379)
* fix(mobile): keep gestures on the key bar from clicking the remote

The key bar sits inside the remote canvas's gesture region, so any tap,
double tap or long press its buttons do not take went to the canvas
recognizers: a tap between keys clicked the remote, two quick taps on a
key double-clicked it, and a long press right-clicked it, with any
latched modifier added. Wrap the bar in an opaque GestureDetector that
claims those gestures; its recognizers join the arena before the
canvas's, so they win.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(mobile): move the key bar out of the canvas gesture region

The GestureDetector wrapper won the arena but the canvas recognizers still
saw every touch on the bar: onLongPressDown sends a left-button down to a
mobile peer before the arena decides, so a long press on the bar lost its
button-up, and the canvas double-tap recognizer kept delaying and dropping
quick key taps.

Drop the wrapper and stack the bar above the canvas instead of inside it,
so a touch on the bar never reaches the canvas recognizers. The remote
cursor and the virtual mouse move up with it and stay above the bar, as
they were inside the canvas stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(mobile): keep the mouse-mode virtual mouse inside the canvas gesture region

Holding a virtual left/right button while another finger drags relies on
the canvas recognizer seeing both pointers: it then takes the
isSpecialHoldDragActive branch of onTwoFingerScaleUpdate. With the virtual
mouse moved above the key bar and out of the region, the recognizer saw
only the dragging finger, routed it through onOneFingerPanUpdate, and any
movement of the holding finger set blockEvents and froze the drag while the
remote button stayed down. Put FloatingMouseWidgets back where master has
it; the cursor and the touch-mode virtual mouse stay above the bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 20:11:07 +08:00
RustDeskandClaude Opus 5.5 ecf60f961e fix(windows): ship app icons with a frame for every shell size (#17412)
The Flutter runner's app_icon.ico had a single 48 px frame, so Explorer,
shortcuts and the taskbar scaled it up at larger icon views and display
scales. Regenerate it from res/icon.png, which the old frame was made
from, with 16, 20, 24, 32, 40, 48, 64, 96, 128 and 256 px frames.

res/icon.ico (the downloadable portable exe, the MSI and the Sciter
build) stopped at 128 px. Add a 256 px frame and keep its other frames
byte for byte.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 17:30:46 +08:00
RustDeskandClaude Opus 5.5 ae717917e2 fix(appimage): verify bundled apt packages and keep the CWD off search paths (#17404)
* fix(appimage): verify bundled apt packages and keep the CWD off XDG dirs

The AppImage recipes fetched the Ubuntu packages they bundle (libc6, GTK,
GStreamer, ...) over HTTP with allow_unauthenticated, and the aarch64 key
came from the keyserver over HTTP. Use the HTTPS archive, drop
allow_unauthenticated, and trust Ubuntu's 2012 and 2018 archive signing
keys, both of which sign focal, from a key file in the repository.

XDG_DATA_DIRS and XDG_CONFIG_DIRS end with the host value, which AppRun
expands to nothing when the host leaves it unset; the empty element makes
GLib search the current directory, so launching the AppImage from a
directory someone else can write let it supply gtk-3.0/settings.ini and
similar files. Put a "/" before the host value: unset it leaves the root,
set its first absolute path becomes the same "//path".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(appimage): keep the CWD off LD_LIBRARY_PATH when the host has none

AppRun sets LD_LIBRARY_PATH to "$APPDIR_LIBRARY_PATH:" followed by the
host's value, so a host without LD_LIBRARY_PATH (the usual case) gets an
empty last element, which the dynamic loader searches as the current
directory. RustDesk looked up libpulsecommon and libGLX there, and the
loginctl it runs looked up libsystemd-shared there on every call, so a
library planted in the directory the AppImage is started from would be
loaded. Patch AppRun to drop empty elements after building the value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 12:00:47 +08:00
Xzar 26f17dff05 fix(mobile): keep file manager bottom sheet above system navigation bar (#17393) 2026-12-04 11:36:13 +08:00
RustDeskandClaude Opus 5.5 b67c5279f9 fix(linux): wake the tray event loop at its WaitUntil deadline (#17403)
Bump rustdesk-org/tao to 74684bd8, a cherry-pick of tauri-apps/tao#1458.
On Linux, tao's run_return blocked in gtk::main_iteration_do(true) for
ControlFlow::WaitUntil with no GLib source for the deadline, so an idle
loop slept until some unrelated event arrived. The tray polls menu events
under a 100 ms WaitUntil, so a menu click could wait many seconds (#17124).
The patch only touches src/platform_impl/linux/event_loop.rs.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 11:22:19 +08:00
HelixNebula f50d282872 ci: install hash-pinned dependencies in the signing steps (#17390)
The two 'Sign rustdesk files' steps ran 'pip3 install requests argparse'
unpinned, in the same step that passes SIGN_SECRET_KEY to res/job.py.
argparse is part of the standard library; the PyPI package is an old,
unneeded backport. Install requests and its dependencies from a
hash-locked requirements file instead, as res/update already does for
the update-metadata signing step. The versions support Python 3.9+.
2026-12-04 11:00:23 +08:00
HelixNebula 711d026151 ci: do not persist checkout credentials (#17391)
actions/checkout stores the job's GITHUB_TOKEN in .git/config unless
persist-credentials is false. No job except update-webpki-roots (which
pushes a branch and is left unchanged) uses git with that token after
checkout, so set persist-credentials: false on the other checkouts. This
keeps the token out of the workspace that build scripts, vcpkg ports,
cargo build scripts and run-on-arch containers can read.
2026-12-04 10:57:30 +08:00
RustDeskandClaude Opus 5.5 40e3672a9d fix(macos): stop ScreenCaptureKit audio capture when the stream is dropped (#17378)
Bump cpal to rustdesk-org/cpal@3361bd6 (rustdesk-org/cpal#8). The
ScreenCaptureKit backend released its native stream on drop without
calling stopCapture; it now stops a playing stream asynchronously and
keeps the native objects alive until the stop completes.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 23:09:37 +08:00
RustDeskandClaude Opus 5.5 9cbafa5f0e fix: keep the Telegram bot token out of logs and off TLS fallback (#17375)
* fix: redact Telegram tokens and zeroize session passwords

* fix: keep the Telegram bot token out of logs and off TLS fallback

The Telegram bot API carries the bot token in the URL path. Telegram
requests went through post_request, which logs the failed reqwest error,
URL included, at warn level before retrying and then returns it, and the
2FA path logs it again. Whenever api.telegram.org was unreachable, each
2FA login wrote the token to the log file. On a TLS error post_request
also retried with invalid certificates accepted, so whoever presented a
certificate on the path received the token and the 2FA code.

Send Telegram requests once with verified rustls, without fallback, and
drop the URL from their errors. Other post_request callers are unchanged.

Revert the Zeroizing session password: the plaintext password is also
held by the Dart UI, the login dialog path and argv, so wiping the
preset copy changed nothing observable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 20:53:17 +08:00
fufesou 8522f17a7a Update rustls to 0.23.46 (#17371)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-12-03 15:57:46 +08:00
fufesou f705ebeb8d Fix/privacy mode display crash recovery (#17333)
* fix(windows): recover privacy mode displays after a forced exit

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retain pending privacy display recovery across restarts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve pending privacy recovery during cleanup and activation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): clear obsolete privacy display recovery records

Recheck active Amyuni displays during the existing monitor timeout before retiring a missing target. Keep the record for ambiguous selections and unplug errors so a stale record does not block the next privacy session after the monitor is gone.

Read the saved Windows display name through its first terminator. Cover stale and temporary absences separately from a failed driver request.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retire missing privacy displays with other monitors active

Check for the saved Amyuni display before treating multiple active displays as ambiguous. Two unrelated displays can then remain connected while an obsolete recovery record expires. Cover that case in the existing recovery selection test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): recheck pending display recovery before activation

A Mode 2 request can skip monitor preparation when the owner or selected implementation changes. Check the saved recovery record under the activation lock before enumerating displays so the new session cannot replace the pending record.

Exercise activation without preparation in the isolated Windows recovery test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): attempt privacy display recovery once at startup

Select a sole matching Amyuni display from the first scan and verify removal after the driver request. Consume the record after checking the registry even on unplug failure, so preparation, activation and idle shutdown can use their normal paths.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): limit privacy display recovery to server startup

Read the saved Amyuni display only in the startup unplug branch. Keep the existing registry parser and unconditional record reset, including when display recovery fails. Cover the display-only record and legacy parsing without a callback or child process.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-12-03 13:27:42 +08:00
RustDeskandClaude Opus 5.5 805b5a5a23 fix(flutter): leave no orphan "waiting for image" dialog on reconnect (#17357)
OverlayDialogManager.show() keeps one dialog per tag. Showing a second
dialog under a tag that is already open replaces the map entry but
leaves the first overlay inserted, so neither dismissByTag() nor
dismissAll() can remove it.

The waiting-for-image dialog can be shown twice before the first frame.
On a reconnect to a Windows host with several Windows sessions, the
client already has the session selected, so handle_peer_info() reports
the wait and the automatic send_selected_session_id() reports it again.
The first overlay then stays on top of the remote view after video
starts, and after Cancel it stays over the peer list, blocking taps.

Dismiss any waiting dialog of the session before showing a new one.

Fixes #17233


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:30:53 +08:00
aseeb shibin 21c7bb71ce fix(clipboard): avoid triggering lazy macOS file URL providers (#17328)
Signed-off-by: aseeb shibin <aseebshibin4@gmail.com>
2026-12-02 22:22:04 +08:00
RustDeskandClaude Opus 5.5 8dd5ab4378 fix(appimage): look up host libraries in /usr/lib on aarch64 (#17358)
* fix(appimage): look up host libraries in /usr/lib on aarch64

The AppImage puts host library and GStreamer plugin paths before its own
so that Wayland capture uses the host's GStreamer and PipeWire. Those
paths were /lib64 and the Debian multiarch dir only. Arch Linux ARM has
neither on aarch64 (its filesystem package adds lib64 only on x86_64),
so the AppImage ran on its bundled focal stack: GStreamer 1.16 with
libpipewire 0.2, which crashes against PipeWire 1.x when the capture
pipeline is created. x86_64 Arch is not affected because /lib64 points
to /usr/lib there.

Add /usr/lib after the multiarch dir in APPDIR_LIBRARY_PATH, and the
matching /usr/lib/gstreamer-1.0 and /usr/lib/gio/modules entries.

Fixes #17301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(appimage): drop the no-op GIO_MODULE_DIR entry

GLib reads GIO_MODULE_DIR as a single directory, not a search path, so
a /usr/lib/gio/modules entry in it changes nothing. Keep the change to
the library and GStreamer plugin paths, and put the comment above the
library path it explains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:11:54 +08:00
99 changed files with 1515 additions and 164 deletions

No files matched your search

@@ -38,6 +38,7 @@ set -euo pipefail
readonly NO_MATCHES=0
readonly SINGLE_MATCH=1
readonly THEME_MATCHES=2
readonly CONNECTION_PAGE=flutter/lib/desktop/pages/connection_page.dart
has_exact_count() {
local -r expected_count="$1"
@@ -93,6 +94,10 @@ validate_patch_inputs() {
echo "Flutter 3.44 source patch input is missing or unreadable: flutter/lib/common/widgets/dialog.dart" >&2
return 1
fi
if [[ ! -f "$CONNECTION_PAGE" || ! -r "$CONNECTION_PAGE" ]]; then
echo "Flutter 3.44 source patch input is missing or unreadable: $CONNECTION_PAGE" >&2
return 1
fi
}
# The lock diff reverses only once applied, so a restored pubspec.lock is not taken as patched.
@@ -118,7 +123,8 @@ is_complete_patch_state() {
'scrollbarTheme: scrollbarThemeDark,' 'backgroundColor: Color(0xFF18191E),' \
flutter/lib/common.dart &&
has_exact_count "$SINGLE_MATCH" 'selectAllOnFocus: isDesktop ? false : null,' \
flutter/lib/common/widgets/dialog.dart
flutter/lib/common/widgets/dialog.dart &&
has_exact_count "$SINGLE_MATCH" 'selectAllOnFocus: isDesktop ? false : null,' "$CONNECTION_PAGE"
}
is_unpatched_state() {
@@ -134,7 +140,9 @@ is_unpatched_state() {
has_exact_count "$NO_MATCHES" 'google_fonts: ^8.1.0' flutter/pubspec.yaml &&
has_exact_count "$SINGLE_MATCH" 'inputFormatters: inputFormatters,' \
flutter/lib/common/widgets/dialog.dart &&
has_exact_count "$NO_MATCHES" 'selectAllOnFocus' flutter/lib/common/widgets/dialog.dart
has_exact_count "$NO_MATCHES" 'selectAllOnFocus' flutter/lib/common/widgets/dialog.dart &&
has_exact_count "$SINGLE_MATCH" 'controller: fieldTextEditingController,' "$CONNECTION_PAGE" &&
has_exact_count "$NO_MATCHES" 'selectAllOnFocus' "$CONNECTION_PAGE"
}
if ! validate_patch_inputs; then
@@ -144,7 +152,7 @@ fi
if is_complete_patch_state && has_lock_patch; then
echo "Flutter 3.44 source patches already applied."
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml \
flutter/lib/common/widgets/dialog.dart
flutter/lib/common/widgets/dialog.dart "$CONNECTION_PAGE"
exit 0
fi
@@ -170,6 +178,10 @@ sed -i 's/google_fonts: \^6.2.1/google_fonts: ^8.1.0/' flutter/pubspec.yaml
# DialogTextField keeps the caret when a desktop field regains focus (see the header):
sed -i 's/inputFormatters: inputFormatters,/inputFormatters: inputFormatters,\
selectAllOnFocus: isDesktop ? false : null,/' flutter/lib/common/widgets/dialog.dart
# Refreshing suggestions rewrites the remote ID and invalidates its selection.
# Flutter 3.44 then applies the focus selection policy even while the field stays focused.
sed -i 's/controller: fieldTextEditingController,/controller: fieldTextEditingController,\
selectAllOnFocus: isDesktop ? false : null,/' "$CONNECTION_PAGE"
# Fail loudly if any expected substitution did not produce the complete state.
if ! is_complete_patch_state; then
@@ -178,4 +190,4 @@ if ! is_complete_patch_state; then
fi
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml \
flutter/lib/common/widgets/dialog.dart
flutter/lib/common/widgets/dialog.dart "$CONNECTION_PAGE"
@@ -12,7 +12,7 @@
#
# Idempotent. To undo the source changes locally:
# git checkout -- flutter/lib/common.dart flutter/lib/common/widgets/dialog.dart \
# flutter/pubspec.yaml flutter/pubspec.lock
# flutter/lib/desktop/pages/connection_page.dart flutter/pubspec.yaml flutter/pubspec.lock
set -euo pipefail
flutter --version | grep -q "Flutter 3\.44\." || {
+13
View File
@@ -0,0 +1,13 @@
# Locked, hash-checked dependencies of res/job.py for the release-signing steps.
# Install with: pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
# argparse is part of the standard library and must not be installed from PyPI.
requests==2.32.5 \
--hash=sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6
urllib3==2.6.3 \
--hash=sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4
idna==3.20 \
--hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
certifi==2026.10.23 \
--hash=sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1
charset-normalizer==3.5.2 \
--hash=sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685
+1
View File
@@ -46,6 +46,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install prerequisites
+1
View File
@@ -109,6 +109,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install prerequisites
+16 -3
View File
@@ -66,7 +66,7 @@ env:
VCPKG_COMMIT_ID: "9e593bb18ea69cc5095e012465dcd675a822ed0d"
VCPKG_CMAKE_VERSION: "4.3.0"
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836" # 2025.01.13, got "/opt/artifacts/vcpkg/vcpkg: No such file or directory" with latest version
VERSION: "1.5.3"
VERSION: "1.5.4"
NDK_VERSION: "r28c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -127,6 +127,7 @@ jobs:
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install Syft
@@ -221,6 +222,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Restore bridge files
@@ -466,7 +468,7 @@ jobs:
if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != '-2'
shell: bash
run: |
pip3 install requests argparse
pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
BASE_URL=${{ env.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./rustdesk/
- name: Verify Windows Flutter version
@@ -660,6 +662,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install LLVM and Clang
@@ -774,7 +777,7 @@ jobs:
if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != '-2'
shell: bash
run: |
pip3 install requests argparse
pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
BASE_URL=${{ env.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./Release/
- name: Verify Windows Sciter version
@@ -884,6 +887,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install flutter
@@ -1013,6 +1017,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Import the codesign cert
@@ -1591,6 +1596,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Check JNI natives are in ffi.FFI
@@ -1893,6 +1899,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install flutter
@@ -2065,6 +2072,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Set Swap Space
@@ -2525,6 +2533,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install Rust toolchain
@@ -2826,6 +2835,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Modify vcpkg.json for armv7
@@ -3065,6 +3075,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Download Binary
@@ -3141,6 +3152,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Download Binary
@@ -3204,6 +3216,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Prepare env
+3 -1
View File
@@ -17,7 +17,7 @@ env:
TAG_NAME: "nightly"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_COMMIT_ID: "9e593bb18ea69cc5095e012465dcd675a822ed0d"
VERSION: "1.5.3"
VERSION: "1.5.4"
NDK_VERSION: "r26d"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -88,6 +88,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
persist-credentials: false
ref: ${{ matrix.job.ref }}
submodules: recursive
@@ -250,6 +251,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
persist-credentials: false
ref: ${{ matrix.job.ref }}
submodules: recursive
+1
View File
@@ -60,3 +60,4 @@ flutter/web/
/third_party/libdrmtap/
# Local git worktrees
.worktrees/
flutter/*.sh
Generated
+7 -7
View File
@@ -1717,7 +1717,7 @@ dependencies = [
[[package]]
name = "cpal"
version = "0.15.3"
source = "git+https://github.com/rustdesk-org/cpal?branch=osx-screencapturekit#96d4da121b7d949677ac5b6887413a9185fd7f39"
source = "git+https://github.com/rustdesk-org/cpal?branch=osx-screencapturekit#3361bd6aa877e110f6df6cd98dc7c7f6427cb79b"
dependencies = [
"alsa",
"cidre",
@@ -7061,7 +7061,7 @@ dependencies = [
[[package]]
name = "rustdesk"
version = "1.5.3"
version = "1.5.4"
dependencies = [
"android-wakelock",
"android_logger",
@@ -7178,7 +7178,7 @@ dependencies = [
[[package]]
name = "rustdesk-portable-packer"
version = "1.5.3"
version = "1.5.4"
dependencies = [
"brotli",
"dirs 5.0.1",
@@ -7255,9 +7255,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.28"
version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643"
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"log",
"once_cell",
@@ -8209,7 +8209,7 @@ dependencies = [
[[package]]
name = "tao"
version = "0.25.0"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#288c219cb0527e509590c2b2d8e7072aa9feb2d3"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#74684bd8b7f565a0edf9412f7403f6433f0d5efb"
dependencies = [
"bitflags 1.3.2",
"cc",
@@ -8249,7 +8249,7 @@ dependencies = [
[[package]]
name = "tao-macros"
version = "0.1.2"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#288c219cb0527e509590c2b2d8e7072aa9feb2d3"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#74684bd8b7f565a0edf9412f7403f6433f0d5efb"
dependencies = [
"proc-macro2 1.0.93",
"quote 1.0.36",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rustdesk"
version = "1.5.3"
version = "1.5.4"
authors = ["rustdesk <info@rustdesk.com>"]
edition = "2021"
build= "build.rs"
+18 -17
View File
@@ -18,24 +18,22 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.5.3
version: 1.5.4
exec: usr/share/rustdesk/rustdesk
exec_args: $@
apt:
arch:
- arm64
allow_unauthenticated: true
sources:
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
# Ubuntu's 2012 and 2018 archive signing keys (both sign focal), exported from ubuntu-keyring:
# gpg --show-keys ubuntu-archive-keyring.asc. apt trusts them for every source below.
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse
key_url: file:ubuntu-archive-keyring.asc
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
include:
- libc6:arm64
- libgtk-3-0
@@ -79,13 +77,16 @@ AppDir:
# AppRun sets these to "$APPDIR/...:$XDG_DATA_DIRS", and setting them at all suppresses the XDG
# defaults, so a host that leaves them unset loses /usr/share and /etc/xdg. gdk-pixbuf 2.43+
# (Arch, Fedora) then finds no glycin loaders and every PNG decode fails, aborting on the first
# remote cursor. The host value goes last: unset it expands to an empty element, which GLib
# resolves against the CWD, and that must not outrank the defaults below.
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:$XDG_CONFIG_DIRS
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/aarch64-linux-gnu:$APPDIR/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/aarch64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/aarch64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/aarch64-linux-gnu/pulseaudio:$APPDIR/usr/lib/aarch64-linux-gnu/sasl2:$APPDIR/usr/lib/aarch64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/aarch64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
# remote cursor. The host value goes last, after a "/": unset, AppRun expands it to nothing, and
# an empty element would make GLib search the CWD; "/" leaves the root instead, and a set
# value's first absolute path becomes the same "//path".
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:/$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:/$XDG_CONFIG_DIRS
# Host paths come before $APPDIR so Wayland capture uses the host's GStreamer and PipeWire.
# Arch Linux ARM has neither /lib64 nor a multiarch dir on aarch64, only /usr/lib.
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/aarch64-linux-gnu:/usr/lib:$APPDIR/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/aarch64-linux-gnu:$APPDIR/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/aarch64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/aarch64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/aarch64-linux-gnu/pulseaudio:$APPDIR/usr/lib/aarch64-linux-gnu/sasl2:$APPDIR/usr/lib/aarch64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/aarch64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:/usr/lib/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:/usr/lib/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
+17 -14
View File
@@ -18,23 +18,25 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.5.3
version: 1.5.4
exec: usr/share/rustdesk/rustdesk
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
# Ubuntu's 2012 and 2018 archive signing keys (both sign focal), exported from ubuntu-keyring:
# gpg --show-keys ubuntu-archive-keyring.asc. apt trusts them for every source below.
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal main restricted
key_url: file:ubuntu-archive-keyring.asc
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-backports main restricted
universe multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-security main restricted
universe multiverse
include:
# https://github.com/rustdesk/rustdesk/issues/9103
@@ -82,10 +84,11 @@ AppDir:
# AppRun sets these to "$APPDIR/...:$XDG_DATA_DIRS", and setting them at all suppresses the XDG
# defaults, so a host that leaves them unset loses /usr/share and /etc/xdg. gdk-pixbuf 2.43+
# (Arch, Fedora) then finds no glycin loaders and every PNG decode fails, aborting on the first
# remote cursor. The host value goes last: unset it expands to an empty element, which GLib
# resolves against the CWD, and that must not outrank the defaults below.
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:$XDG_CONFIG_DIRS
# remote cursor. The host value goes last, after a "/": unset, AppRun expands it to nothing, and
# an empty element would make GLib search the CWD; "/" leaves the root instead, and a set
# value's first absolute path becomes the same "//path".
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:/$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:/$XDG_CONFIG_DIRS
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/x86_64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/x86_64-linux-gnu/pulseaudio:$APPDIR/usr/lib/x86_64-linux-gnu/sasl2:$APPDIR/usr/lib/x86_64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/x86_64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0
@@ -0,0 +1,41 @@
diff --git a/src/apprun/runtime_interpreter.c b/src/apprun/runtime_interpreter.c
index fe06502..33ddd8e 100644
--- a/src/apprun/runtime_interpreter.c
+++ b/src/apprun/runtime_interpreter.c
@@ -143,6 +143,20 @@ long compare_version_strings(const char *a, const char *b) {
return 0;
}
+/* An empty element, as appending an unset LD_LIBRARY_PATH leaves, makes the dynamic loader search
+ * the current directory. */
+static void apprun_drop_empty_path_elements(char *path) {
+ char *out = path;
+ for (const char *in = path; *in != '\0'; in++) {
+ if (*in == ':' && (out == path || out[-1] == ':'))
+ continue;
+ *out++ = *in;
+ }
+ if (out > path && out[-1] == ':')
+ out--;
+ *out = '\0';
+}
+
void configure_embed_libc() {
#ifdef DEBUG
fprintf(stderr, "APPRUN_DEBUG: using appdir libc\n");
@@ -150,6 +164,7 @@ void configure_embed_libc() {
char *ld_library_path = apprun_shell_expand_variables("$"APPDIR_LIBRARY_PATH_ENV":"
"$"APPDIR_LIBC_LIBRARY_PATH_ENV":"
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
+ apprun_drop_empty_path_elements(ld_library_path);
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
free(ld_library_path);
@@ -161,6 +176,7 @@ void configure_system_libc() {
#endif
char *ld_library_path = apprun_shell_expand_variables("$"APPDIR_LIBRARY_PATH_ENV":"
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
+ apprun_drop_empty_path_elements(ld_library_path);
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
free(ld_library_path);
+6 -2
View File
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
# AppRun v2.0.0, which appimage-builder downloads, splits every argument into a 1 KiB stack
# buffer, so any argument of 1024 bytes or more aborts the AppImage before RustDesk starts.
# Build it with apprun-split-arguments.patch into the path appimage-builder checks before
# downloading. ubuntu:16.04 is what upstream released from, so the host glibc floor is unchanged.
# It also appends the host's LD_LIBRARY_PATH after a ":", so an unset one leaves an empty element
# that makes the loader search the current directory for libraries.
# Build it with apprun-split-arguments.patch and apprun-no-empty-library-path.patch into the path
# appimage-builder checks before downloading. ubuntu:16.04 is what upstream released from, so the
# host glibc floor is unchanged.
set -euo pipefail
arch=$1
@@ -25,6 +28,7 @@ echo "$sha256 $tmp/apprun.tar.gz" | sha256sum -c -
mkdir "$src"
tar -xzf "$tmp/apprun.tar.gz" -C "$src" --strip-components=1
patch -d "$src" -p1 < "$here/apprun-split-arguments.patch"
patch -d "$src" -p1 < "$here/apprun-no-empty-library-path.patch"
docker run --rm -v "$src:/src" -w /src -e DEBIAN_FRONTEND=noninteractive "$image" bash -c "
set -e
+53
View File
@@ -0,0 +1,53 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBE+tgXgBEADfiL1KNFHT4H4Dw0OR9LemR8ebsFl+b9E44IpGhgWYDufj0gaM
/UJ1Ti3bHfRT39VVZ6cv1P4mQy0bnAKFbYz/wo+GhzjBWtn6dThYv7n+KL8bptSC
Xgg1a6en8dCCIA/pwtS2Ut/g4Eu6Z467dvYNlMgCqvg+prKIrXf5ibio48j3AFvd
1dDJl2cHfyuON35/83vXKXz0FPohQ7N7kPfI+qrlGBYGWFzC/QEGje360Q2Yo+rf
MoyDEXmPsoZVqf7EE8gjfnXiRqmz/Bg5YQb5bgnGbLGiHWtjS+ACIdLUq/h+jlSp
57jw8oQktMh2xVMX4utDM0UENeZnPllVJSlR0b+ZmZz7paeSar8Yxn4wsNlL7GZb
pW5A/WmcmWfuMYoPhBo5Fq1V2/siKNU3UKuf1KH+X0p1oZ4oOcZ2bS0Zh3YEG8IQ
ce9Bferq4QMKsekcG9IKS6WBIU7BwaElI2ILD0gSwu8KzvNSEeIJhYSsBIEzrWxI
BXoN2AC9PCqqXkWlI5Xr/86RWllB3CsoPwEfO8CLJW2LlXTen/Fkq4wT+apdhHei
WiSsq/J5OEff0rKHBQ3fK7fyVuVNrJFb2CopaBLyCxTupvxs162jjUNopt0c7OqN
BoPoUoVFAxUSpeEwAw6xrM5vROyLMSeh/YnTuRy8WviRapZCYo6naTCY5wARAQAB
tEJVYnVudHUgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmluZyBLZXkgKDIwMTIpIDxm
dHBtYXN0ZXJAdWJ1bnR1LmNvbT6JAjgEEwECACIFAk+tgXgCGwMGCwkIBwMCBhUI
AgkKCwQWAgMBAh4BAheAAAoJEDtP5qzAsh8yXX4QAJHUdK6eYMyJcrFP3yKXtUYQ
MpaHRM/floqZtOFhlmcLVMgBNOr0eLvBU0JcZyZpHMvZciTDBMWX8ItCYVjRejf0
K0lPvHHRGaE7t6JHVUCeznNbDMnOPYVwlVJdZLOa6PmE5WXVXpk8uTA8vm6RO2rS
23vE7U0pQlV+1GVXMWH4ZLjaQs/Tm7wdvRxeqTbtfOEeHGLjmsoh0erHfzMV4wA/
9Zq86WzuJS1HxXR6OYDC3/aQX7CxYT1MQxEw/PObnHtkl3PRMWdTW7fSQtulEXzp
r2/JCev6Mfc8Uy0aD3jng9byVk9GpdNFEjGgaUqjqyZosvwAZ4/dmRjmMEibXeNU
GC8HeWC3WOVV8L/DiA+miJlwPvwPiA1ZuKBI5A8VF0rNHW7QVsG8kQ+PDHgRdsmh
pzSRgykN1PgK6UxScKX8LqNKCtKpuEPApka7FQ1u4BoZKjjpBhY1R4TpfFkMIe7q
W8XfqoaP99pED3xXch2zFRNHitNJr+yQJH4z/o+2UvnTA2niUTHlFSCBoU1MvSq1
N2J3qU6oR2cOYJ4ZxqWyCoeQR1x8aPnLlcn4le6HU7TocYbHaImcIt7qnG4Ni0OW
P4giEhjOpgxtrWgl36mdufvriwya+EHXzn36EvQ9O+bm3fyarsnhPe01rlsRxqBi
K1JOw/g4GnpX8iLGEX1VmQINBFufwdoBEADv/Gxytx/LcSXYuM0MwKojbBye81s0
G1nEx+lz6VAUpIUZnbkqdXBHC+dwrGS/CeeLuAjPRLU8AoxE/jjvZVp8xFGEWHYd
klqXGZ/gJfP5d3fIUBtZHZEJl8B8m9pMHf/AQQdsC+YzizSG5t5Mhnotw044LXtd
EEkx2t6Jz0OGrh+5IoxqX7pZiq6Cv19BohaUioKMdp7ES6RYfN7ol6HSLFlrMXtV
fh/ijpN9j3ZhVGVeRC8kKHQsJ5PkIbmvxBiUh7SJmfZUx0IQhNMaDHXfdZAGNtnh
zzNReb1FqNLSVkrS/PnsAQzMhG1BDm2VOSF64jebKXffFqM5LXRQTeqTLsjUbbrq
R6s/GCO8UF7jfUj6I7taLygmsHO/JD4jpKRC0gbpUBfaiJyLvuepx3kWoqL3sN0L
hlMI80+fA7GTvoOx4tpqVlzlE6TajYu+jfW3QpOFS5ewEMdL26hzxsZg/geZvTbA
rcP+OsJKRmhv4kNo6AydyHQ/3ZV/f3X9mT3/SPLbJaumkgp3Yzd6t5PeBu+ZQk/m
N5WNNuaihNEV7llb1ZhvY0Fxu9BVd/BNl0rzuxp3rIinB2TX2SCg7wE5xXkwXuQ/
2eTDE0v0HlGntkuZjGowDZkxHZQSxZVOzdZCRVaX/WEFLpKa2AQpw5RJrQ4oZ/Of
ifXyJzP27o03wQARAQABtEJVYnVudHUgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmlu
ZyBLZXkgKDIwMTgpIDxmdHBtYXN0ZXJAdWJ1bnR1LmNvbT6JAjgEEwEKACIFAluf
wdoCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEIcZINGZG8k8LHMQAKS2
cnxz/5WaoCOWArf5g6UHbeOCgc5DBm0hCuFDZWWv427aGei3CPuLw0DGLCXZdyc5
dqE8mvjMlOmmAKKlj1uGg3TYCbQWjWPeMnBPZbkFgkZoXJ7/6CB7bWRht1sHzpt1
LTZ+SYDwOwJ68QRp7DRaZl9Y6QiUbeuhq2DUcTofVbBxbhrckN4ZteLvm+/nG9m/
ciopc66LwRdkxqfJ32Cyq+1TS5VaIJDG7DWziG+Kbu6qCDM4QNlg3LH7p14CrRxA
bc4lvohRgsV4eQqsIcdFkuVY5HPPj2K8TqpY6STe8Gh0aprG1RV8ZKay3KSMpnyV
1fAKn4fM9byiLzQAovC0LZ9MMMsrAS/45AvC3IEKSShjLFn1X1dRCiO6/7jmZEoZ
tAp53hkf8SMBsi78hVNrBumZwfIdBA1v22+LY4xQK8q4XCoRcA9G+pvzU9YVW7cR
nDZZGl0uwOw7z9PkQBF5KFKjWDz4fCk+K6+YtGpovGKekGBb8I7EA6UpvPgqA/Qd
I0t1IBP0N06RQcs1fUaAQEtz6DGy5zkRhR4pGSZn+dFET7PdAjEK84y7BdY4t+U1
jcSIvBj0F2B7LwRL7xGpSpIKi/ekAXLs117bvFHaCvmUYN7JVp1GMmVFxhIdx6CF
m3fxG8QjNb5tere/YqK+uOgcXny1UlwtCUzlrSaP
=GitC
-----END PGP PUBLIC KEY BLOCK-----
+52 -28
View File
@@ -1015,40 +1015,64 @@ class BottomSheetBody extends StatelessWidget {
final _actions = actions ?? [];
return BottomSheet(
builder: (BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final view = View.maybeOf(context);
final viewBottomPadding = view != null && view.devicePixelRatio > 0
? view.padding.bottom / view.devicePixelRatio
: 0.0;
final bottomInset = mediaQuery.padding.bottom > viewBottomPadding
? mediaQuery.padding.bottom
: viewBottomPadding;
return Container(
height: 65,
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
color: MyTheme.accent50,
borderRadius: BorderRadius.vertical(top: Radius.circular(10))),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
leading,
SizedBox(width: 16),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
child: SafeArea(
top: false,
minimum: EdgeInsets.only(bottom: bottomInset),
child: Container(
height: 65,
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(horizontal: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Row(
children: [
Text(title, style: TextStyle(fontSize: 18)),
Text(text,
style: TextStyle(fontSize: 14)) // TODO color
leading,
SizedBox(width: 16),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 18)),
Text(text,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 14)) // TODO color
],
),
)
],
)
],
),
Row(children: () {
_actions.add(IconButton(
icon: Icon(Icons.cancel_outlined),
onPressed: onCanceled,
));
return _actions;
}())
],
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
..._actions,
IconButton(
icon: Icon(Icons.cancel_outlined),
onPressed: onCanceled,
),
],
)
],
),
),
));
},
+31 -22
View File
@@ -566,12 +566,13 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
}
return Container(
color: MyTheme.canvasColor,
child: inputModel.isPhysicalMouse.value
? getBodyForMobile()
: RawTouchGestureDetectorRegion(
child: getBodyForMobile(),
ffi: gFFI,
),
child: withKeyHelpTools(
inputModel.isPhysicalMouse.value
? getBodyForMobile()
: RawTouchGestureDetectorRegion(
child: getBodyForMobile(),
ffi: gFFI,
)),
);
}),
),
@@ -712,6 +713,27 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
!gFFI.canvasModel.cursorEmbedded &&
!gFFI.inputModel.relativeMouseMode.value;
// The key bar sits above the canvas, outside its gesture region: a touch on the bar must not
// also reach the canvas recognizers, which would send it to the remote as a mouse event.
// The cursor and the touch-mode virtual mouse stay above the bar, as they were inside the canvas
// stack. The mouse-mode virtual mouse stays inside the region: see getBodyForMobile.
Widget withKeyHelpTools(Widget body) => Stack(children: [
Positioned.fill(child: body),
Obx(() {
final chatKeyboardRequested =
gFFI.chatModel.softKeyboardRequested.value;
return KeyHelpTools(
keyboardIsVisible: keyboardVisibilityController.isVisible &&
(_showEdit || chatKeyboardRequested),
showGestureHelp: _showGestureHelp);
}),
if (showCursorPaint) CursorPaint(widget.id),
if (gFFI.ffiModel.touchMode)
FloatingMouse(
ffi: gFFI,
),
]);
Widget getBodyForMobile() {
return Container(
color: MyTheme.canvasColor,
@@ -723,14 +745,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
right: 10,
child: QualityMonitor(gFFI.qualityMonitorModel),
),
Obx(() {
final chatKeyboardRequested =
gFFI.chatModel.softKeyboardRequested.value;
return KeyHelpTools(
keyboardIsVisible: keyboardVisibilityController.isVisible &&
(_showEdit || chatKeyboardRequested),
showGestureHelp: _showGestureHelp);
}),
SizedBox(
width: 0,
height: 0,
@@ -762,14 +776,9 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
).workaroundFreezeLinuxMint(),
),
];
if (showCursorPaint) {
paints.add(CursorPaint(widget.id));
}
if (gFFI.ffiModel.touchMode) {
paints.add(FloatingMouse(
ffi: gFFI,
));
} else {
// Holding a virtual button while another finger drags needs both pointers in the canvas
// recognizers (isSpecialHoldDragActive), so these stay inside the gesture region.
if (!gFFI.ffiModel.touchMode) {
paints.add(FloatingMouseWidgets(
ffi: gFFI,
));
+2
View File
@@ -1188,6 +1188,8 @@ class FfiModel with ChangeNotifier {
}
if (waitForFirstImage.isFalse) return;
// A second show under the same tag would orphan the first overlay: no dismiss can reach it.
clearWaitingForImage(dialogManager, sessionId);
dialogManager.show(
(setState, close, context) => CustomAlertDialog(
title: null,
+1 -1
View File
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# 1.1.9-1 works for android, but for ios it becomes 1.1.91, need to set it to 1.1.9-a.1 for iOS, will get 1.1.9.1, but iOS store not allow 4 numbers
version: 1.5.3+71
version: 1.5.4+72
environment:
sdk: '^3.1.0'
@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/mobile/pages/file_manager_page.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
Widget buildSubject({
VoidCallback? onCanceled,
List<IconButton>? actions,
}) {
return MaterialApp(
home: Scaffold(
bottomSheet: BottomSheetBody(
leading: const Icon(Icons.check),
title: 'Wybrano',
text: '1 elementów [Lokalny]',
onCanceled: onCanceled,
actions: actions,
),
),
);
}
testWidgets('keeps action buttons above bottom system navigation bar',
(tester) async {
tester.view.physicalSize = const Size(360, 800);
tester.view.devicePixelRatio = 1.0;
tester.view.padding = const FakeViewPadding(bottom: 48);
tester.view.viewPadding = const FakeViewPadding(bottom: 48);
addTearDown(tester.view.reset);
var canceled = false;
await tester.pumpWidget(buildSubject(
onCanceled: () => canceled = true,
actions: [
IconButton(icon: const Icon(Icons.save_alt), onPressed: () {}),
IconButton(icon: const Icon(Icons.compare_arrows), onPressed: () {}),
IconButton(icon: const Icon(Icons.delete_forever), onPressed: () {}),
],
));
expect(tester.takeException(), isNull);
expect(tester.getSize(find.byType(BottomSheetBody)).height, 113.0);
for (final icon in const [
Icons.save_alt,
Icons.compare_arrows,
Icons.delete_forever,
Icons.cancel_outlined,
]) {
expect(tester.getBottomRight(find.byIcon(icon)).dy,
lessThanOrEqualTo(752.0));
}
await tester.tap(find.byIcon(Icons.cancel_outlined));
await tester.pump();
expect(canceled, isTrue);
});
testWidgets('preserves default height when bottom inset is zero',
(tester) async {
tester.view.physicalSize = const Size(360, 800);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);
await tester.pumpWidget(buildSubject());
expect(tester.takeException(), isNull);
expect(tester.getSize(find.byType(BottomSheetBody)).height, 65.0);
});
}
@@ -0,0 +1,66 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/common/widgets/peers_view.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/desktop/pages/connection_page.dart';
import 'package:flutter_hbb/generated_bridge.dart';
import 'package:flutter_hbb/models/peer_model.dart';
import 'package:flutter_hbb/models/platform_model.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';
class _OutgoingClient extends Fake implements RustdeskImpl {
@override
bool isOutgoingOnly({dynamic hint}) => true;
@override
bool isDisableAb({dynamic hint}) => true;
@override
bool isDisableGroupPanel({dynamic hint}) => true;
@override
bool mainIsOptionFixed({required String key, dynamic hint}) => false;
@override
String mainGetLocalOption({required String key, dynamic hint}) => '';
@override
String getLocalFlutterOption({required String k, dynamic hint}) =>
k == kOptionPeerTabVisible ? '[false,false,false,false,false]' : '';
@override
Future<void> setLocalFlutterOption(
{required String k, required String v, dynamic hint}) async {}
@override
String translate(
{required String name, required String locale, dynamic hint}) =>
'';
@override
Future<String> mainGetLastRemoteId({dynamic hint}) async => '';
@override
Future<void> mainLoadRecentPeers({dynamic hint}) async {}
@override
Future<void> mainLoadLanPeers({dynamic hint}) async {}
}
void main() {
testWidgets('refreshing recent peers keeps the remote ID caret',
(tester) async {
isTest = true;
platformFFI.setBindingForTesting(_OutgoingClient());
await initGlobalFFI();
await tester.pumpWidget(MaterialApp(
theme: MyTheme.lightTheme,
home: ChangeNotifierProvider.value(
value: gFFI.peerTabModel,
child: const Scaffold(body: ConnectionPage()),
),
));
final field = find.descendant(
of: find.byType(RawAutocomplete<Peer>),
matching: find.byType(TextField));
await tester.showKeyboard(field);
await tester.pumpAndSettle();
await tester.enterText(field, 'lhb');
await platformFFI.tryHandle({'name': LoadEvent.recent, 'peers': '[]'});
await tester.pumpAndSettle();
expect(tester.widget<TextField>(field).controller!.selection,
const TextSelection.collapsed(offset: 3));
}, variant: TargetPlatformVariant.only(TargetPlatform.windows));
}
@@ -0,0 +1,68 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/generated_bridge.dart';
import 'package:flutter_hbb/models/platform_model.dart';
import 'package:flutter_test/flutter_test.dart';
class _Binding extends Fake implements RustdeskImpl {
@override
String translate(
{required String name, required String locale, dynamic hint}) =>
name;
@override
String mainGetLocalOption({required String key, dynamic hint}) => '';
@override
String getLocalFlutterOption({required String k, dynamic hint}) => '';
@override
bool isDisableAb({dynamic hint}) => false;
@override
bool isDisableAccount({dynamic hint}) => false;
@override
bool isDisableGroupPanel({dynamic hint}) => false;
@override
Future<void> sessionOnWaitingForImageDialogShow(
{required SessionID sessionId, dynamic hint}) async {}
@override
Future<void> sessionInputOsPassword(
{required SessionID sessionId,
required String value,
dynamic hint}) async {}
}
void main() {
setUpAll(() async {
isTest = true;
platformFFI.setBindingForTesting(_Binding());
await initGlobalFFI();
});
// A reconnect to an already selected Windows session reports the wait twice.
testWidgets('no waiting dialog is left after a repeated wait is dismissed',
(tester) async {
await tester.pumpWidget(MaterialApp(
navigatorKey: globalKey,
home: const Scaffold(),
));
final model = gFFI.ffiModel;
model.waitForFirstImage.value = true;
for (var i = 0; i < 2; i++) {
model.showConnectedWaitingForImage(gFFI.dialogManager, gFFI.sessionId,
'success', 'Successful', kMsgboxTextWaitingForImage);
}
await tester.pump();
expect(find.text(kMsgboxTextWaitingForImage), findsWidgets);
// Both the first frame and leaving the remote page end in dismissAll().
gFFI.dialogManager.dismissAll();
await tester.pump(const Duration(seconds: 2));
expect(find.text(kMsgboxTextWaitingForImage), findsNothing);
});
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 39 KiB

@@ -3,6 +3,8 @@ mod paste_observer;
mod paste_task;
pub mod pasteboard_context;
pub use pasteboard_context::has_rustdesk_file_url_owner;
pub fn should_handle_msg(msg: &crate::ClipboardFile) -> bool {
matches!(
msg,
@@ -29,6 +29,7 @@ lazy_static::lazy_static! {
}
pub const TEMP_FILE_PREFIX: &str = ".rustdesk_";
const RUSTDESK_FILE_URL_OWNER_TYPE: &str = "com.rustdesk.file-url-owner";
#[derive(Default, Debug, Clone, PartialEq)]
pub(super) struct PasteObserverInfo {
@@ -293,6 +294,10 @@ impl PasteboardContext {
)]);
let item = objc2_app_kit::NSPasteboardItem::new();
item.setDataProvider_forTypes(&ProtocolObject::from_id(provider), &types);
item.setString_forType(
&NSString::from_str(""),
&NSString::from_str(RUSTDESK_FILE_URL_OWNER_TYPE),
);
self.pasteboard.clearContents();
if !self
.pasteboard
@@ -430,3 +435,82 @@ pub fn create_pasteboard_context() -> ResultType<Box<PasteboardContext>> {
context.init();
Ok(context)
}
pub fn has_rustdesk_file_url_owner() -> bool {
autoreleasepool(|_| unsafe {
let Some(pasteboard): Option<Id<NSPasteboard>> =
msg_send_id![NSPasteboard::class(), generalPasteboard]
else {
return false;
};
let Some(items) = pasteboard.pasteboardItems() else {
return false;
};
items.iter().any(|item| {
item.types()
.iter()
.any(|ty| ty.to_string() == RUSTDESK_FILE_URL_OWNER_TYPE)
})
})
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn ownership_check_skips_lazy_provider_until_external_read() {
struct TempFileGuard(String);
impl Drop for TempFileGuard {
fn drop(&mut self) {
if let Err(e) = std::fs::remove_file(&self.0) {
eprintln!("failed to remove temp file {}: {e}", self.0);
}
}
}
let pasteboard: Option<Id<NSPasteboard>> =
unsafe { msg_send_id![NSPasteboard::class(), generalPasteboard] };
let pasteboard = pasteboard.expect("failed to get general pasteboard");
let (tx, rx) = channel();
let (tx_paste_task, rx_paste_task) = channel();
let context = PasteboardContext {
pasteboard: pasteboard.clone(),
observer: Arc::new(Mutex::new(PasteObserver::new())),
tx_handle: Some(ContextInfo {
tx,
handle: thread::spawn(|| {}),
}),
tx_remove_file: None,
remove_file_handle: None,
tx_paste_task,
paste_task: Arc::new(Mutex::new(PasteTask::new(rx_paste_task))),
};
let before_count = PasteboardContext::temp_files_count();
autoreleasepool(|_| {
context
.set_clipboard_item(context.tx_handle.as_ref().unwrap(), 9, 7)
.unwrap();
});
assert!(has_rustdesk_file_url_owner());
assert!(
rx.try_recv().is_err(),
"ownership check must not invoke lazy file-url provider"
);
assert_eq!(PasteboardContext::temp_files_count(), before_count);
let url = unsafe { pasteboard.stringForType(NSPasteboardTypeFileURL) }
.expect("external read should resolve lazy file URL")
.to_string();
let task_info = rx
.try_recv()
.expect("external read should notify provider channel")
.expect("provider should create placeholder file");
let _guard = TempFileGuard(task_info.source_path.clone());
assert!(url.ends_with(&task_info.source_path));
assert!(Path::new(&task_info.source_path).exists());
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rustdesk-portable-packer"
version = "1.5.3"
version = "1.5.4"
edition = "2021"
description = "RustDesk Remote Desktop"
+1 -1
View File
@@ -24,7 +24,7 @@ use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use base::platform::linux::{WaylandDisplayInfo, CMD_SH};
use hbb_common::{anyhow::anyhow, bail, config, serde_json, tokio, ResultType};
use hbb_common::{anyhow::anyhow, bail, config, serde_json, ResultType};
use super::capturable::PixelProvider;
use super::capturable::{Capturable, Recorder};
+1 -1
View File
@@ -1,5 +1,5 @@
pkgname=rustdesk
pkgver=1.5.3
pkgver=1.5.4
pkgrel=0
epoch=
pkgdesc=""
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 122 KiB

+1 -1
View File
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.5.3
Version: 1.5.4
Release: 0
Summary: RPM package
License: GPL-3.0
+1 -1
View File
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.5.3
Version: 1.5.4
Release: 0
Summary: RPM package
License: GPL-3.0
+1 -1
View File
@@ -1,5 +1,5 @@
Name: rustdesk
Version: 1.5.3
Version: 1.5.4
Release: 0
Summary: RPM package
License: GPL-3.0
+82 -5
View File
@@ -4,10 +4,11 @@ use hbb_common::{
config::Config,
get_time,
password_security::{decrypt_vec_or_original, encrypt_vec_or_original},
tls::TlsType,
ResultType,
};
use serde_derive::{Deserialize, Serialize};
use std::sync::Mutex;
use std::{fmt, sync::Mutex, time::Duration};
use totp_rs::{Algorithm, Secret, TOTP};
lazy_static::lazy_static! {
@@ -111,7 +112,7 @@ pub fn get_2fa(raw: Option<String>) -> Option<TOTP> {
.unwrap_or_default()
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[derive(Clone, Default, Serialize, Deserialize)]
pub struct TelegramBot {
#[serde(skip)]
pub token_str: String,
@@ -119,6 +120,16 @@ pub struct TelegramBot {
pub chat_id: String,
}
impl fmt::Debug for TelegramBot {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("TelegramBot")
.field("token_str", &"[redacted]")
.field("token", &"[redacted]")
.field("chat_id", &self.chat_id)
.finish()
}
}
impl TelegramBot {
fn into_string(&self) -> ResultType<String> {
let token = encrypt_vec_or_original(self.token_str.as_bytes(), "00", 1024);
@@ -154,18 +165,39 @@ impl TelegramBot {
}
}
// The URL carries the bot token: never fall back to accepting an invalid certificate, and drop
// the URL from errors so the token stays out of the log.
async fn post_telegram(url: String, body: String) -> ResultType<String> {
let resp = crate::hbbs_http::create_http_client_async(TlsType::Rustls, false)
.post(url)
.header("Content-Type", "application/json")
.body(body)
.timeout(Duration::from_secs(12))
.send()
.await
.map_err(|e| anyhow!("{:?}", e.without_url()))?;
resp.text()
.await
.map_err(|e| anyhow!("{:?}", e.without_url()))
}
// https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1
pub async fn send_2fa_code_to_telegram(text: &str, bot: TelegramBot) -> ResultType<()> {
let url = format!("https://api.telegram.org/bot{}/sendMessage", bot.token_str);
let params = serde_json::json!({"chat_id": bot.chat_id, "text": text});
crate::post_request(url, params.to_string(), "").await?;
post_telegram(url, params.to_string()).await?;
Ok(())
}
pub fn get_chatid_telegram(bot_token: &str) -> ResultType<Option<String>> {
let url = format!("https://api.telegram.org/bot{}/getUpdates", bot_token);
// because caller is in tokio runtime, so we must call post_request_sync in new thread.
let handle = std::thread::spawn(move || crate::post_request_sync(url, "".to_owned(), ""));
// because caller is in tokio runtime, so we must run the request in a new thread.
let handle = std::thread::spawn(move || -> ResultType<String> {
hbb_common::tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?
.block_on(post_telegram(url, String::new()))
});
let resp = handle.join().map_err(|_| anyhow!("Thread panicked"))??;
let value = serde_json::from_str::<serde_json::Value>(&resp).map_err(|e| anyhow!(e))?;
@@ -202,3 +234,48 @@ pub fn get_chatid_telegram(bot_token: &str) -> ResultType<Option<String>> {
Ok(chat_id)
}
#[cfg(test)]
mod tests {
use super::{post_telegram, TelegramBot};
use hbb_common::tokio::{self, net::TcpListener};
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
#[test]
fn telegram_bot_debug_redacts_both_token_fields() {
let bot = TelegramBot {
token_str: "test-telegram-token".to_owned(),
token: vec![17, 29, 43],
chat_id: "test-chat".to_owned(),
};
let debug = format!("{bot:?}");
assert!(!debug.contains(&bot.token_str));
assert!(!debug.contains(&format!("{:?}", bot.token)));
assert!(debug.contains(&bot.chat_id));
}
#[tokio::test]
async fn telegram_request_has_no_tls_fallback_and_hides_the_token() {
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let port = listener.local_addr().unwrap().port();
let attempts = Arc::new(AtomicUsize::new(0));
let counter = attempts.clone();
tokio::spawn(async move {
while let Ok((stream, _)) = listener.accept().await {
counter.fetch_add(1, Ordering::SeqCst);
drop(stream);
}
});
let token = "123456:test-telegram-token";
let url = format!("https://127.0.0.1:{port}/bot{token}/sendMessage");
let err = post_telegram(url, String::new()).await.unwrap_err();
assert!(!err.to_string().contains(token), "{err}");
assert_eq!(attempts.load(Ordering::SeqCst), 1);
}
}
+22
View File
@@ -758,6 +758,26 @@ impl<T: InvokeUiSession> Remote<T> {
match data {
Data::Close => {
self.send_close_reason(peer, "").await;
if peer.is_webrtc() {
// Reconnect starts the next round without waiting for this one, and that
// round reuses this peer's file clipboard channel. Give it up before the
// wait, or this round's cleanup removes the channel the next one is using.
#[cfg(any(target_os = "windows", feature = "unix-file-copy-paste"))]
clipboard::remove_channel_by_conn_id(self.client_conn_id);
// The next round also loads the saved transfer jobs as soon as it logs in.
// The wait discards what arrives, so the jobs no longer change after this.
let _ = self.sync_jobs_status_to_local().await;
// Makes the save on exit a no-op, so it cannot write these jobs over what a
// newer round saved in the meantime.
self.is_connected = false;
// Dropping the stream can discard the queued reason, and then the controlled
// side keeps this session for a password-free reconnect. It closes once it
// has read the reason.
let _ = tokio::time::timeout(Duration::from_secs(1), async {
while let Some(Ok(_)) = peer.next().await {}
})
.await;
}
return false;
}
Data::Login((os_username, os_password, password, remember)) => {
@@ -1699,6 +1719,7 @@ impl<T: InvokeUiSession> Remote<T> {
Some(message::Union::VideoFrame(vf)) => {
if !self.first_frame {
self.first_frame = true;
log::info!("Received first video frame");
self.handler.close_success();
self.handler.adapt_size();
self.send_toggle_virtual_display_msg(peer).await;
@@ -2354,6 +2375,7 @@ impl<T: InvokeUiSession> Remote<T> {
}
}
Some(misc::Union::CloseReason(c)) => {
log::info!("Received CloseReason from the controlled side: {c:?}");
self.sent_close_reason = true; // The controlled end will close, no need to send close reason
self.handler.msgbox("error", "Connection Error", &c, "");
return false;
+23
View File
@@ -408,6 +408,14 @@ impl ClipboardContext {
side: ClipboardSide,
force: bool,
) -> ResultType<Vec<ClipboardData>> {
#[cfg(all(feature = "unix-file-copy-paste", target_os = "macos"))]
{
if formats.iter().any(|f| matches!(f, ClipboardFormat::FileUrl))
&& clipboard::platform::unix::macos::has_rustdesk_file_url_owner()
{
return Ok(vec![]);
}
}
let _lock = ARBOARD_MTX.lock().unwrap();
let data = self.get_formats(formats)?;
if data.is_empty() {
@@ -512,6 +520,21 @@ impl ClipboardContext {
#[cfg(feature = "unix-file-copy-paste")]
fn try_empty_clipboard_files(&mut self, side: ClipboardSide) {
let _lock = ARBOARD_MTX.lock().unwrap();
#[cfg(all(feature = "unix-file-copy-paste", target_os = "macos"))]
{
if clipboard::platform::unix::macos::has_rustdesk_file_url_owner() {
if let Err(e) = self.inner.set_formats(&[
ClipboardData::Text("".to_string()),
ClipboardData::Special((
RUSTDESK_CLIPBOARD_OWNER_FORMAT.to_owned(),
side.get_owner_data(),
)),
]) {
log::error!("Failed to empty clipboard files: {}", e);
}
return;
}
}
if let Ok(data) = self.get_formats(&[ClipboardFormat::FileUrl]) {
let urls = Self::get_file_urls_set_by_rustdesk(data, side);
if !urls.is_empty() {
+2 -2
View File
@@ -193,7 +193,7 @@ impl Drop for KcpStream {
}
#[cfg(test)]
mod tests {
pub(crate) mod tests {
use super::*;
use std::time::Duration;
@@ -205,7 +205,7 @@ mod tests {
(Arc::new(a), Arc::new(b))
}
async fn establish() -> ((KcpStream, Stream), (KcpStream, Stream)) {
pub(crate) async fn establish() -> ((KcpStream, Stream), (KcpStream, Stream)) {
let (a, b) = connected_pair().await;
let (accept_res, connect_res) = tokio::join!(
KcpStream::accept(b, Duration::from_secs(5), None),
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "وضع لوحة المفاتيح"),
("Enable Unicode input", "تفعيل إدخال Unicode"),
("unicode-input-tip", "التقاط نص Unicode الذي ترسله أدوات مثل KeePassXC Auto-Type. يتطلب استخدام مصدر الإدخال 1."),
("Remote terminal access requires an active desktop session", "يتطلب الوصول إلى الطرفية عن بُعد جلسة سطح مكتب نشطة"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Klaviatura rejimi"),
("Enable Unicode input", "Unicode girişini aktivləşdir"),
("unicode-input-tip", "KeePassXC Auto-Type kimi alətlərin göndərdiyi Unicode mətnini tutun. Giriş mənbəyi 1 tələb olunur."),
("Remote terminal access requires an active desktop session", "Terminala uzaqdan daxil olmaq üçün aktiv masaüstü sessiyası tələb olunur"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Рэжым клавіятуры"),
("Enable Unicode input", "Уключыць увод Unicode"),
("unicode-input-tip", "Захопліваць тэкст Unicode, які дасылаюць інструменты накшталт KeePassXC Auto-Type. Патрабуецца крыніца ўводу 1."),
("Remote terminal access requires an active desktop session", "Для аддаленага доступу да тэрмінала патрэбны актыўны сеанс працоўнага стала"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Режим на клавиатурата"),
("Enable Unicode input", "Разрешаване на въвеждане на Unicode"),
("unicode-input-tip", "Прихващане на Unicode текст, изпратен от инструменти като KeePassXC Auto-Type. Изисква източник на въвеждане 1."),
("Remote terminal access requires an active desktop session", "За отдалечен достъп до терминала е необходима активна сесия на работния плот"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Mode de teclat"),
("Enable Unicode input", "Habilita l'entrada Unicode"),
("unicode-input-tip", "Captura el text Unicode enviat per eines com ara KeePassXC Auto-Type. Requereix la font d'entrada 1."),
("Remote terminal access requires an active desktop session", "Per accedir al terminal de manera remota cal una sessió d’escriptori activa"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "键盘模式"),
("Enable Unicode input", "启用 Unicode 输入"),
("unicode-input-tip", "捕获 KeePassXC 自动输入等工具发送的 Unicode 文本。需要使用输入源 1。"),
("Remote terminal access requires an active desktop session", "访问远程终端需要一个活动的桌面会话"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Režim klávesnice"),
("Enable Unicode input", "Povolit vstup Unicode"),
("unicode-input-tip", "Zachytávat text Unicode odesílaný nástroji, jako je KeePassXC Auto-Type. Vyžaduje zdroj vstupu 1."),
("Remote terminal access requires an active desktop session", "Pro vzdálený přístup k terminálu je potřeba aktivní relace pracovní plochy"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tastaturtilstand"),
("Enable Unicode input", "Aktivér Unicode-input"),
("unicode-input-tip", "Opfang Unicode-tekst sendt af værktøjer som KeePassXC Auto-Type. Kræver inputkilde 1."),
("Remote terminal access requires an active desktop session", "Fjernadgang til terminalen kræver en aktiv skrivebordssession"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tastaturmodus"),
("Enable Unicode input", "Unicode-Eingabe aktivieren"),
("unicode-input-tip", "Unicode-Text erfassen, der von Werkzeugen wie KeePassXC Auto-Type gesendet wird. Erfordert Eingabequelle 1."),
("Remote terminal access requires an active desktop session", "Der Fernzugriff auf das Terminal erfordert eine aktive Desktop-Sitzung"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Λειτουργία πληκτρολογίου"),
("Enable Unicode input", "Ενεργοποίηση εισαγωγής Unicode"),
("unicode-input-tip", "Λήψη κειμένου Unicode που αποστέλλεται από εργαλεία όπως το KeePassXC Auto-Type. Απαιτείται η πηγή εισόδου 1."),
("Remote terminal access requires an active desktop session", "Η απομακρυσμένη πρόσβαση στο τερματικό απαιτεί ενεργή συνεδρία επιφάνειας εργασίας"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Klavara reĝimo"),
("Enable Unicode input", "Ebligi Unicode-enigon"),
("unicode-input-tip", "Kapti Unicode-tekston senditan de iloj kiel KeePassXC Auto-Type. Postulas enigfonton 1."),
("Remote terminal access requires an active desktop session", "Fora aliro al la terminalo postulas aktivan labortablan seancon"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modo de teclado"),
("Enable Unicode input", "Habilitar la entrada Unicode"),
("unicode-input-tip", "Captura texto Unicode enviado por herramientas como KeePassXC Auto-Type. Requiere la fuente de entrada 1."),
("Remote terminal access requires an active desktop session", "Para acceder al terminal de forma remota se necesita una sesión de escritorio activa"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Klaviatuurirežiim"),
("Enable Unicode input", "Luba Unicode'i sisestus"),
("unicode-input-tip", "Püüa kinni selliste tööriistade nagu KeePassXC Auto-Type saadetud Unicode'i tekst. Nõuab sisendallikat 1."),
("Remote terminal access requires an active desktop session", "Kaugjuurdepääs terminalile nõuab aktiivset töölauaseanssi"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Teklatuaren modua"),
("Enable Unicode input", "Gaitu Unicode sarrera"),
("unicode-input-tip", "Atzeman KeePassXC Auto-Type bezalako tresnek bidalitako Unicode testua. 1. sarrera-iturria behar du."),
("Remote terminal access requires an active desktop session", "Terminalera urrunetik sartzeko, mahaigaineko saio aktibo bat behar da"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "حالت صفحه کلید"),
("Enable Unicode input", "فعال‌سازی ورودی Unicode"),
("unicode-input-tip", "متن Unicode ارسال‌شده توسط ابزارهایی مانند KeePassXC Auto-Type را دریافت می‌کند. به منبع ورودی 1 نیاز دارد."),
("Remote terminal access requires an active desktop session", "دسترسی از راه دور به ترمینال به یک نشست فعال دسکتاپ نیاز دارد"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Näppäimistötila"),
("Enable Unicode input", "Ota Unicode-syöte käyttöön"),
("unicode-input-tip", "Sieppaa työkalujen (esimerkiksi KeePassXC Auto-Type) lähettämää Unicode-tekstiä. Vaatii syötelähteen 1."),
("Remote terminal access requires an active desktop session", "Päätteen etäkäyttö edellyttää aktiivista työpöytäistuntoa"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Mode du clavier"),
("Enable Unicode input", "Activer la saisie Unicode"),
("unicode-input-tip", "Capturer le texte Unicode envoyé par des outils tels que KeePassXC Auto-Type. Nécessite la source d'entrée 1."),
("Remote terminal access requires an active desktop session", "L’accès à distance au terminal nécessite une session de bureau active"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "კლავიატურის რეჟიმი"),
("Enable Unicode input", "Unicode შეყვანის ჩართვა"),
("unicode-input-tip", "Unicode ტექსტის მიღება, რომელსაც აგზავნიან ისეთი ხელსაწყოები, როგორიცაა KeePassXC Auto-Type. საჭიროა შეყვანის წყარო 1."),
("Remote terminal access requires an active desktop session", "ტერმინალზე დისტანციური წვდომისთვის საჭიროა სამუშაო მაგიდის აქტიური სესია"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modo de teclado"),
("Enable Unicode input", "Activar a entrada Unicode"),
("unicode-input-tip", "Capturar o texto Unicode enviado por ferramentas como KeePassXC Auto-Type. Require a fonte de entrada 1."),
("Remote terminal access requires an active desktop session", "Para acceder ao terminal de forma remota cómpre ter unha sesión de escritorio activa"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "કીબોર્ડ મોડ"),
("Enable Unicode input", "Unicode ઇનપુટ સક્ષમ કરો"),
("unicode-input-tip", "KeePassXC Auto-Type જેવા સાધનો દ્વારા મોકલાયેલ Unicode લખાણ કૅપ્ચર કરો. ઇનપુટ સ્રોત 1 જરૂરી છે."),
("Remote terminal access requires an active desktop session", "ટર્મિનલને રિમોટ રીતે ઍક્સેસ કરવા માટે સક્રિય ડેસ્કટોપ સત્ર જરૂરી છે"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "מצב מקלדת"),
("Enable Unicode input", "אפשר קלט Unicode"),
("unicode-input-tip", "לכידת טקסט Unicode שנשלח מכלים כגון KeePassXC Auto-Type. נדרש מקור קלט 1."),
("Remote terminal access requires an active desktop session", "כדי לגשת למסוף מרחוק נדרשת הפעלת שולחן עבודה פעילה"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "कीबोर्ड मोड"),
("Enable Unicode input", "Unicode इनपुट सक्षम करें"),
("unicode-input-tip", "KeePassXC Auto-Type जैसे टूल द्वारा भेजे गए Unicode पाठ को कैप्चर करें। इसके लिए इनपुट स्रोत 1 आवश्यक है।"),
("Remote terminal access requires an active desktop session", "टर्मिनल तक दूरस्थ पहुँच के लिए एक सक्रिय डेस्कटॉप सत्र आवश्यक है"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Način rada tipkovnice"),
("Enable Unicode input", "Omogući Unicode unos"),
("unicode-input-tip", "Hvatanje Unicode teksta koji šalju alati poput KeePassXC Auto-Type. Potreban je izvor unosa 1."),
("Remote terminal access requires an active desktop session", "Za udaljeni pristup terminalu potrebna je aktivna sesija radne površine"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Billentyűzetmód"),
("Enable Unicode input", "Unicode-bevitel engedélyezése"),
("unicode-input-tip", "Az olyan eszközök által küldött Unicode-szöveg rögzítése, mint a KeePassXC Auto-Type. Az 1. bemeneti forrást igényli."),
("Remote terminal access requires an active desktop session", "A terminál távoli eléréséhez aktív asztali munkamenet szükséges"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Mode papan ketik"),
("Enable Unicode input", "Aktifkan input Unicode"),
("unicode-input-tip", "Tangkap teks Unicode yang dikirim oleh alat seperti KeePassXC Auto-Type. Memerlukan sumber input 1."),
("Remote terminal access requires an active desktop session", "Akses terminal jarak jauh memerlukan sesi desktop yang aktif"),
].iter().cloned().collect();
}
+4 -3
View File
@@ -830,8 +830,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("drm-capture-tip", "Cattura lo schermo direttamente dalla scheda grafica tramite il servizio RustDesk, senza il prompt di condivisione dello schermo Wayland, anche al login schermo. Potrebbe non funzionare con tutti i dispositivi; se le connessioni chiedono ancora di condividere lo schermo, disabilita questa opzione o usa X11. La modifica di questa opzione disconnetterà le sessioni attuali."),
("wayland-drm-tip", "Per l'accesso non presidiato in Wayland, prova 'Cattura schermo DRM', o se non funziona usa X11."),
("login-wayland-drm-tip", "Per accedere alla schermata di accesso Wayland, prova 'Cattura schermo DRM' o passa a X11."),
("Keyboard mode", ""),
("Enable Unicode input", ""),
("unicode-input-tip", ""),
("Keyboard mode", "Modo tastiera"),
("Enable Unicode input", "Abilita input Unicode"),
("unicode-input-tip", "Cattura testo Unicode inviato da strumenti come KeePassXC Auto-Type. Richiede input sorgente 1."),
("Remote terminal access requires an active desktop session", ""),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "キーボードモード"),
("Enable Unicode input", "Unicode 入力を有効にする"),
("unicode-input-tip", "KeePassXC Auto-Type などのツールが送信する Unicode テキストを取り込みます。入力ソース 1 が必要です。"),
("Remote terminal access requires an active desktop session", "ターミナルへのリモートアクセスには、アクティブなデスクトップセッションが必要です"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "키보드 모드"),
("Enable Unicode input", "Unicode 입력 활성화"),
("unicode-input-tip", "KeePassXC Auto-Type 같은 도구가 보내는 Unicode 텍스트를 캡처합니다. 입력 소스 1이 필요합니다."),
("Remote terminal access requires an active desktop session", "터미널에 원격으로 접속하려면 활성 데스크톱 세션이 필요합니다"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Пернетақта режимі"),
("Enable Unicode input", "Unicode енгізуін қосу"),
("unicode-input-tip", "KeePassXC Auto-Type сияқты құралдар жіберген Unicode мәтінін қабылдау. Енгізу көзі 1 қажет."),
("Remote terminal access requires an active desktop session", "Терминалға қашықтан қол жеткізу үшін белсенді жұмыс үстелі сеансы қажет"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Klaviatūros režimas"),
("Enable Unicode input", "Įgalinti Unicode įvestį"),
("unicode-input-tip", "Perimti Unicode tekstą, kurį siunčia tokie įrankiai kaip KeePassXC Auto-Type. Reikalingas įvesties šaltinis 1."),
("Remote terminal access requires an active desktop session", "Nuotolinei prieigai prie terminalo reikia aktyvaus darbalaukio seanso"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tastatūras režīms"),
("Enable Unicode input", "Iespējot Unicode ievadi"),
("unicode-input-tip", "Pārtvert Unicode tekstu, ko nosūta tādi rīki kā KeePassXC Auto-Type. Nepieciešams ievades avots 1."),
("Remote terminal access requires an active desktop session", "Lai attālināti piekļūtu terminālim, ir nepieciešama aktīva darbvirsmas sesija"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "കീബോർഡ് മോഡ്"),
("Enable Unicode input", "Unicode ഇൻപുട്ട് പ്രവർത്തനക്ഷമമാക്കുക"),
("unicode-input-tip", "KeePassXC Auto-Type പോലുള്ള ഉപകരണങ്ങൾ അയയ്ക്കുന്ന Unicode ടെക്സ്റ്റ് ക്യാപ്‌ചർ ചെയ്യുക. ഇൻപുട്ട് ഉറവിടം 1 ആവശ്യമാണ്."),
("Remote terminal access requires an active desktop session", "ടെർമിനൽ വിദൂരമായി ആക്‌സസ് ചെയ്യാൻ സജീവമായ ഒരു ഡെസ്ക്ടോപ്പ് സെഷൻ ആവശ്യമാണ്"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tastaturmodus"),
("Enable Unicode input", "Aktiver Unicode-inndata"),
("unicode-input-tip", "Fang opp Unicode-tekst som sendes av verktøy som KeePassXC Auto-Type. Krever inndatakilde 1."),
("Remote terminal access requires an active desktop session", "Fjerntilgang til terminalen krever en aktiv skrivebordsøkt"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Toetsenbordmodus"),
("Enable Unicode input", "Unicode-invoer inschakelen"),
("unicode-input-tip", "Unicode-tekst opvangen die wordt verzonden door hulpmiddelen zoals KeePassXC Auto-Type. Vereist invoerbron 1."),
("Remote terminal access requires an active desktop session", "Voor toegang op afstand tot de terminal is een actieve bureaubladsessie vereist"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tryb klawiatury"),
("Enable Unicode input", "Włącz wprowadzanie Unicode"),
("unicode-input-tip", "Przechwytuj tekst Unicode wysyłany przez narzędzia takie jak KeePassXC Auto-Type. Wymaga źródła wejścia 1."),
("Remote terminal access requires an active desktop session", "Zdalny dostęp do terminala wymaga aktywnej sesji pulpitu"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modo do teclado"),
("Enable Unicode input", "Habilitar entrada Unicode"),
("unicode-input-tip", "Captura texto Unicode enviado por ferramentas como o KeePassXC Auto-Type. Requer a fonte de entrada 1."),
("Remote terminal access requires an active desktop session", "O acesso remoto ao terminal requer uma sessão ativa da área de trabalho"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modo do teclado"),
("Enable Unicode input", "Ativar entrada Unicode"),
("unicode-input-tip", "Captura texto Unicode enviado por ferramentas como o KeePassXC Auto-Type. Requer a fonte de entrada 1."),
("Remote terminal access requires an active desktop session", "O acesso remoto ao terminal requer uma sessão ativa do ambiente de trabalho"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Mod tastatură"),
("Enable Unicode input", "Activează introducerea Unicode"),
("unicode-input-tip", "Capturează textul Unicode trimis de instrumente precum KeePassXC Auto-Type. Necesită sursa de intrare 1."),
("Remote terminal access requires an active desktop session", "Accesul de la distanță la terminal necesită o sesiune desktop activă"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Режим клавиатуры"),
("Enable Unicode input", "Включить ввод Unicode"),
("unicode-input-tip", "Перехватывать текст Unicode, отправляемый такими инструментами, как KeePassXC Auto-Type. Требуется источник ввода 1."),
("Remote terminal access requires an active desktop session", "Для удалённого доступа к терминалу нужен активный сеанс рабочего стола"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modalidade de tecladu"),
("Enable Unicode input", "Abìlita s'intrada Unicode"),
("unicode-input-tip", "Catura su testu Unicode imbiadu dae ainas comente KeePassXC Auto-Type. Bisòngiat sa mitza de intrada 1."),
("Remote terminal access requires an active desktop session", "Pro acèdere a su terminale dae tesu serbit una sessione de iscrivania ativa"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Režim klávesnice"),
("Enable Unicode input", "Povoliť vstup Unicode"),
("unicode-input-tip", "Zachytávať text Unicode odosielaný nástrojmi, ako je KeePassXC Auto-Type. Vyžaduje sa zdroj vstupu 1."),
("Remote terminal access requires an active desktop session", "Vzdialený prístup k terminálu vyžaduje aktívnu reláciu pracovnej plochy"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Način tipkovnice"),
("Enable Unicode input", "Omogoči vnos Unicode"),
("unicode-input-tip", "Zajemi besedilo Unicode, ki ga pošiljajo orodja, kot je KeePassXC Auto-Type. Zahteva vir vnosa 1."),
("Remote terminal access requires an active desktop session", "Za oddaljeni dostop do terminala je potrebna aktivna seja namizja"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Modaliteti i tastierës"),
("Enable Unicode input", "Aktivizo hyrjen Unicode"),
("unicode-input-tip", "Kap tekstin Unicode të dërguar nga mjete si KeePassXC Auto-Type. Kërkon burimin e hyrjes 1."),
("Remote terminal access requires an active desktop session", "Për të hyrë në terminal nga larg, nevojitet një sesion aktiv i desktopit"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Režim tastature"),
("Enable Unicode input", "Omogući Unicode unos"),
("unicode-input-tip", "Hvatanje Unicode teksta koji šalju alati kao što je KeePassXC Auto-Type. Zahteva izvor unosa 1."),
("Remote terminal access requires an active desktop session", "Za udaljeni pristup terminalu potrebna je aktivna sesija radne površine"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Tangentbordsläge"),
("Enable Unicode input", "Aktivera Unicode-inmatning"),
("unicode-input-tip", "Fånga Unicode-text som skickas av verktyg som KeePassXC Auto-Type. Kräver inmatningskälla 1."),
("Remote terminal access requires an active desktop session", "Fjärråtkomst till terminalen kräver en aktiv skrivbordssession"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "விசைப்பலகை முறை"),
("Enable Unicode input", "Unicode உள்ளீட்டை இயக்கு"),
("unicode-input-tip", "KeePassXC Auto-Type போன்ற கருவிகள் அனுப்பும் Unicode உரையைப் பிடிக்கவும். உள்ளீட்டு மூலம் 1 தேவை."),
("Remote terminal access requires an active desktop session", "முனையத்தைத் தொலைவிலிருந்து அணுக, செயலில் உள்ள டெஸ்க்டாப் அமர்வு தேவை"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", ""),
("Enable Unicode input", ""),
("unicode-input-tip", ""),
("Remote terminal access requires an active desktop session", ""),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "โหมดคีย์บอร์ด"),
("Enable Unicode input", "เปิดใช้งานการป้อนข้อมูล Unicode"),
("unicode-input-tip", "จับข้อความ Unicode ที่ส่งจากเครื่องมือ เช่น KeePassXC Auto-Type โดยต้องใช้แหล่งป้อนข้อมูล 1"),
("Remote terminal access requires an active desktop session", "การเข้าถึงเทอร์มินัลจากระยะไกลต้องใช้เซสชันเดสก์ท็อปที่กำลังใช้งานอยู่"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Klavye modu"),
("Enable Unicode input", "Unicode girişini etkinleştir"),
("unicode-input-tip", "KeePassXC Auto-Type gibi araçların gönderdiği Unicode metnini yakalar. Giriş kaynağı 1 gerektirir."),
("Remote terminal access requires an active desktop session", "Terminale uzaktan erişim için etkin bir masaüstü oturumu gerekir"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "鍵盤模式"),
("Enable Unicode input", "啟用 Unicode 輸入"),
("unicode-input-tip", "擷取 KeePassXC 自動輸入等工具傳送的 Unicode 文字。需要使用輸入來源 1。"),
("Remote terminal access requires an active desktop session", "若要存取遠端終端機,必須有作用中的桌面工作階段"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Режим клавіатури"),
("Enable Unicode input", "Увімкнути введення Unicode"),
("unicode-input-tip", "Перехоплювати текст Unicode, надісланий такими інструментами, як KeePassXC Auto-Type. Потрібне джерело введення 1."),
("Remote terminal access requires an active desktop session", "Для віддаленого доступу до термінала потрібен активний сеанс стільниці"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "کی بورڈ موڈ"),
("Enable Unicode input", "Unicode ان پٹ کو فعال کریں"),
("unicode-input-tip", "KeePassXC Auto-Type جیسے ٹولز کے بھیجے گئے Unicode متن کو کیپچر کریں۔ ان پٹ کا ماخذ 1 درکار ہے۔"),
("Remote terminal access requires an active desktop session", "ٹرمینل تک ریموٹ رسائی کے لیے ایک فعال ڈیسک ٹاپ سیشن درکار ہے"),
].iter().cloned().collect();
}
+1
View File
@@ -833,5 +833,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Keyboard mode", "Chế độ bàn phím"),
("Enable Unicode input", "Bật đầu vào Unicode"),
("unicode-input-tip", "Thu nhận văn bản Unicode do các công cụ như KeePassXC Auto-Type gửi đến. Yêu cầu nguồn đầu vào 1."),
("Remote terminal access requires an active desktop session", "Cần có một phiên màn hình nền đang hoạt động để truy cập terminal từ xa"),
].iter().cloned().collect();
}
+107 -13
View File
@@ -2,6 +2,8 @@ use super::{gtk_sudo, CursorData, ResultType};
use desktop::Desktop;
pub use base::platform::linux::*;
pub(crate) mod terminal;
#[cfg(feature = "drm")]
pub fn dispatch_wayland_display_probe() {
use std::ffi::OsStr;
@@ -1089,9 +1091,16 @@ mod audio_latency_env_tests {
}
}
const LOGIND_SESSION_ARG: &str = "--logind-session=";
#[inline]
fn try_start_server_(desktop: Option<&Desktop>) -> ResultType<Option<Child>> {
match desktop {
let session = desktop
.map_or(Some(""), Desktop::root_server_session)
.map(|id| format!("{LOGIND_SESSION_ARG}{id}"));
let mut args = vec!["--server"];
args.extend(session.as_deref());
match desktop.filter(|desktop| !desktop.uses_service_environment()) {
Some(desktop) => {
let mut envs = vec![];
if !desktop.display.is_empty() {
@@ -1131,17 +1140,22 @@ fn try_start_server_(desktop: Option<&Desktop>) -> ResultType<Option<Child>> {
get_cur_term(&desktop.uid).unwrap_or_else(|| suggest_best_term()),
));
run_as_user(
vec!["--server"],
args,
Some((desktop.uid.clone(), desktop.username.clone())),
envs,
)
}
None => Ok(Some(crate::run_me(vec!["--server"])?)),
None => Ok(Some(crate::run_me(args)?)),
}
}
#[inline]
fn start_server(desktop: Option<&Desktop>, server: &mut Option<Child>) {
// should_start_server checked before force_stop_server() and the DRM greeter grace, so a
// sleep requested in between would otherwise still get a --server.
if is_system_preparing_for_sleep() {
return;
}
match try_start_server_(desktop) {
Ok(ps) => *server = ps,
Err(err) => {
@@ -1275,10 +1289,47 @@ fn should_start_server(
} else {
start_new = true;
}
if start_new && is_system_preparing_for_sleep() {
start_new = false;
}
*cm0 = cm;
start_new
}
// A --server started while the system enters sleep probes the GPU encoders, and NVENC init during
// suspend entry can hang the NVIDIA driver (#17208). logind keeps PreparingForSleep set from the
// sleep request until the system has resumed, so the start is retried by the loop after wake.
fn is_system_preparing_for_sleep() -> bool {
use dbus::blocking::{stdintf::org_freedesktop_dbus::Properties, Connection};
let preparing = Connection::new_system().and_then(|conn| {
conn.with_proxy(
"org.freedesktop.login1",
"/org/freedesktop/login1",
Duration::from_secs(1),
)
.get::<bool>("org.freedesktop.login1.Manager", "PreparingForSleep")
});
match preparing {
Ok(true) => {
hbb_common::throttled_log!(
Duration::from_secs(60),
info,
"system is preparing for sleep; --server starts after wake"
);
true
}
Ok(false) => false,
Err(err) => {
hbb_common::throttled_log!(
Duration::from_secs(600),
warn,
"failed to read logind PreparingForSleep: {err}"
);
false
}
}
}
// to-do: stop_server(&mut user_server); may not stop child correctly
// stop_rustdesk_servers() is just a temp solution here.
fn force_stop_server() {
@@ -1329,14 +1380,16 @@ pub fn start_os_service() {
update_active_user_lookup_cache(&desktop);
// Duplicate logic here with should_start_server.
if desktop.username == "root" || desktop.is_login_wayland() {
let root_desktop = desktop.uses_service_environment().then_some(&desktop);
let root_session_changed = desktop.uid == "0" && sid != desktop.sid;
if root_desktop.is_some() || desktop.is_login_wayland() {
// try kill subprocess "--server"
stop_server(&mut user_server);
// try start subprocess "--server"
// No need to check is_display_changed here.
// A switch between root logins needs a new server bound to the selected session.
if should_start_server(
true,
false,
root_session_changed,
&mut uid,
&desktop,
&mut cm0,
@@ -1350,14 +1403,13 @@ pub fn start_os_service() {
// SDDM Wayland greeter (is_gdm_user covers both) or a greetd one (tty_greeter), and
// desktop.uid is that greeter's uid, so this drops to whichever greeter owns seat0.
// A greeter neither recognizes (e.g. LightDM) never reaches this branch -- it takes
// the unprivileged else-branch below already. A genuine root graphical session (username=="root")
// the unprivileged else-branch below already. A genuine root graphical session (UID 0)
// has no lower uid to drop to, so it stays root. The whole branch is gated on the drm
// feature and on allow-drm-capture; otherwise it is upstream's single
// `start_server(None, ..)` line.
// feature and on allow-drm-capture. Only a root desktop supplies a session ID for terminals.
#[cfg(not(feature = "drm"))]
start_server(None, &mut server);
start_server(root_desktop, &mut server);
#[cfg(feature = "drm")]
if drm_capture_enabled() && desktop.username != "root" && !desktop.uid.is_empty() {
if drm_capture_enabled() && root_desktop.is_none() && !desktop.uid.is_empty() {
start_server(Some(&desktop), &mut server);
// If dropping to the greeter uid did not produce a RUNNING server, fall back to a
// root --server so the login screen stays remotable instead of looping on a
@@ -1375,14 +1427,15 @@ pub fn start_os_service() {
start_server(None, &mut server);
}
} else {
start_server(None, &mut server);
start_server(root_desktop, &mut server);
}
}
} else if desktop.username != "" {
// try kill subprocess "--server"
stop_server(&mut server);
let is_display_changed = desktop.display != display || desktop.xauth != xauth;
let is_display_changed =
root_session_changed || desktop.display != display || desktop.xauth != xauth;
display = desktop.display.clone();
xauth = desktop.xauth.clone();
@@ -2449,6 +2502,22 @@ mod desktop {
super::is_gdm_user(&self.username) && self.protocol == DISPLAY_SERVER_WAYLAND
}
/// An empty session ID marks a privileged greeter and denies its terminal.
pub(super) fn root_server_session(&self) -> Option<&str> {
if self.uid != "0" {
return None;
}
if self.username.is_empty() || self.is_login_wayland() {
Some("")
} else {
Some(&self.sid)
}
}
pub(super) fn uses_service_environment(&self) -> bool {
self.uid == "0" && (self.username == "root" || self.is_login_wayland())
}
/// The greeter's compositor creates its socket after logind has registered the session,
/// so a greeter first seen without one is asked again on every refresh until it has one.
/// Every compositor variable is dropped, not only the x11 values guessed meanwhile: going
@@ -2888,6 +2957,31 @@ mod desktop {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn uid_zero_alias_binds_terminal_to_its_desktop() {
let session = |uid: &str, username: &str, protocol: &str| Desktop {
sid: "8".into(),
uid: uid.into(),
username: username.into(),
protocol: protocol.into(),
..Desktop::default()
};
let admin = session("0", "desktop-admin", DISPLAY_SERVER_WAYLAND);
assert_eq!(admin.root_server_session(), Some("8"));
assert!(!admin.uses_service_environment());
assert!(session("0", "root", DISPLAY_SERVER_WAYLAND).uses_service_environment());
let user = session("1000", "root", DISPLAY_SERVER_X11);
assert_eq!(user.root_server_session(), None);
let greeter = session("0", "gdm", DISPLAY_SERVER_WAYLAND);
assert_eq!(greeter.root_server_session(), Some(""));
assert!(greeter.uses_service_environment());
}
}
}
/// A session-bus idle-inhibit interface, tried in order; the first that answers wins.
+262
View File
@@ -0,0 +1,262 @@
use super::{CMD_LOGINCTL, LOGIND_SESSION_ARG};
use dbus::{
blocking::{stdintf::org_freedesktop_dbus::Properties, Connection},
Path,
};
use hbb_common::{
anyhow::{ensure, Context},
timeout, tokio, users, whoami, ResultType,
};
const SESSION_LOOKUP_TIMEOUT_MS: u64 = 2_000;
const DBUS_TIMEOUT: std::time::Duration =
std::time::Duration::from_millis(SESSION_LOOKUP_TIMEOUT_MS);
const LOGIN1: &str = "org.freedesktop.login1";
const LOGIN1_PATH: &str = "/org/freedesktop/login1";
pub(crate) async fn is_allowed() -> ResultType<bool> {
let arg = std::env::args_os().nth(2).unwrap_or_default();
let selector = logind_selector(arg.to_str().filter(|_| crate::is_server()));
session_allows_terminal(users::get_effective_uid(), selector).await
}
fn logind_selector(arg: Option<&str>) -> Option<&str> {
match arg.and_then(|arg| arg.strip_prefix(LOGIND_SESSION_ARG)) {
Some("") => None, // The service explicitly marked a greeter fallback.
None => Some(""), // Even on logind v237, an empty selector means the caller's own session.
Some(id) => Some(id),
}
}
async fn session_allows_terminal(uid: u32, selector: Option<&str>) -> ResultType<bool> {
if uid != 0 {
return Ok(true);
}
let Some(id) = selector else { return Ok(false) };
let mut cmd = tokio::process::Command::new(CMD_LOGINCTL.as_str());
cmd.kill_on_drop(true).args(["show-session", "--all"]);
for field in [
"Id", "User", "Class", "State", "Remote", "Seat", "Type", "Display",
] {
cmd.args(["-p", field]);
}
cmd.args(["--", id]);
let output = timeout(SESSION_LOOKUP_TIMEOUT_MS, cmd.output())
.await
.context("loginctl show-session timed out")?
.context("could not run loginctl show-session")?;
let status = output.status;
ensure!(
status.success(),
"loginctl show-session failed ({status}): {}",
String::from_utf8_lossy(&output.stderr).trim_end()
);
let properties = std::str::from_utf8(&output.stdout)?;
let display = std::env::var("DISPLAY").ok();
let check = root_desktop_display(properties, id, display.as_deref());
verify_display(check, local_x11_session).await
}
enum DisplayCheck<'a> {
Matched,
SocketSession { number: u32, session: &'a str },
}
fn root_desktop_display<'a>(
properties: &'a str,
id: &str,
display: Option<&str>,
) -> Option<DisplayCheck<'a>> {
let value = |key: &str| {
let mut fields = properties.lines().filter_map(|line| line.strip_prefix(key));
let first = fields.next()?;
fields.next().is_none().then_some(first)
};
if (!id.is_empty() && value("Id=")? != id)
|| value("User=")? != "0"
// Active stays yes while a logging-out session still holds the seat; State is closing then.
|| value("State=")? != "active"
|| value("Remote=")? != "no"
|| value("Seat=")?.is_empty()
|| !matches!(
value("Class=")?,
"user" | "user-early" | "user-light" | "user-early-light"
)
{
return None;
}
match value("Type=")? {
"wayland" => Some(DisplayCheck::Matched),
"x11" => {
let server = x11_server(display?)?;
match value("Display=")? {
// GDM on Xorg can leave Display empty on an active graphical session.
"" if server.0.is_empty() && server.1.bytes().all(|b| b.is_ascii_digit()) => {
Some(DisplayCheck::SocketSession {
number: server.1.parse().ok()?,
session: value("Id=").filter(|id| !id.is_empty())?,
})
}
expected if x11_server(expected) == Some(server) => Some(DisplayCheck::Matched),
_ => None,
}
}
_ => None,
}
}
async fn verify_display<F>(
check: Option<DisplayCheck<'_>>,
socket_session: impl FnOnce(u32) -> F,
) -> ResultType<bool>
where
F: std::future::Future<Output = ResultType<String>>,
{
match check {
Some(DisplayCheck::Matched) => Ok(true),
Some(DisplayCheck::SocketSession { number, session }) => {
Ok(socket_session(number).await? == session)
}
None => Ok(false),
}
}
async fn local_x11_session(number: u32) -> ResultType<String> {
timeout(SESSION_LOOKUP_TIMEOUT_MS, async {
let (pid, _socket) = local_x11_peer(number).await?;
tokio::task::spawn_blocking(move || x11_peer_logind_session(pid)).await?
})
.await
.context("X11 session lookup timed out")?
}
async fn local_x11_peer(number: u32) -> ResultType<(u32, tokio::net::UnixStream)> {
use std::io::ErrorKind::{ConnectionRefused, NotFound};
let path = format!("/tmp/.X11-unix/X{number}");
let mut peer = None;
// X11 transports can use either name. If both exist, they must identify the same server.
for name in [format!("\0{path}"), path] {
let socket = match tokio::net::UnixStream::connect(name).await {
Ok(socket) => socket,
Err(err) if matches!(err.kind(), NotFound | ConnectionRefused) => continue,
Err(err) => return Err(err.into()),
};
let cred = socket.peer_cred()?;
ensure!(cred.uid() == 0, "local X11 peer does not run as root");
let pid = cred
.pid()
.filter(|&p| p > 0)
.context("local X11 socket has no peer PID")? as u32;
if let Some((previous, _)) = &peer {
ensure!(*previous == pid, "local X11 sockets have different peers");
} else {
peer = Some((pid, socket));
}
}
peer.context("no local X11 socket for the root desktop")
}
fn x11_peer_logind_session(pid: u32) -> ResultType<String> {
let bus = Connection::new_system()?;
let manager = bus.with_proxy(LOGIN1, LOGIN1_PATH, DBUS_TIMEOUT);
let (path,): (Path<'static>,) =
manager.method_call("org.freedesktop.login1.Manager", "GetSessionByPID", (pid,))?;
let session = bus.with_proxy(LOGIN1, path, DBUS_TIMEOUT);
const SESSION: &str = "org.freedesktop.login1.Session";
let id = session.get(SESSION, "Id")?;
ensure!(
session.get::<String>(SESSION, "State")? == "active",
"local X11 peer session is not active"
);
Ok(id)
}
fn x11_server(display: &str) -> Option<(&str, &str)> {
let (host, number) = display.rsplit_once(':')?;
let number = number.split('.').next()?;
let local = matches!(host, "" | "unix" | "unix/")
|| whoami::fallible::hostname().ok().as_deref() == Some(host);
(!number.is_empty()).then_some((if local { "" } else { host }, number))
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn greeter_fallback_denies_only_root_terminals() {
let fallback = logind_selector(Some(LOGIND_SESSION_ARG));
assert_eq!(fallback, None);
assert!(!session_allows_terminal(0, fallback).await.unwrap());
assert!(session_allows_terminal(117, fallback).await.unwrap());
assert_eq!(logind_selector(None), Some(""));
assert_eq!(logind_selector(Some("--logind-session=7")), Some("7"));
}
#[tokio::test]
async fn gdm_x11_with_empty_display_can_authorize_its_own_root_desktop() {
let session =
"Id=8\nUser=0\nClass=user\nSeat=seat0\nState=active\nRemote=no\nType=x11\nDisplay=";
for (display, peer_session, allowed) in [
(":1", "8", true),
("unix/:1", "8", true),
("unix/:1", "9", false),
] {
let check = root_desktop_display(session, "8", Some(display));
let result = verify_display(check, |number| {
assert_eq!(number, 1);
std::future::ready(Ok(peer_session.to_owned()))
})
.await
.unwrap();
assert_eq!(result, allowed);
}
assert!(root_desktop_display(session, "8", Some("remote:1")).is_none());
for invalid in [
session.replace("Class=user", "Class=greeter"),
session.replace("\nDisplay=", ""),
format!("{session}\nDisplay="),
] {
assert!(root_desktop_display(&invalid, "8", Some(":1")).is_none());
}
}
#[test]
fn root_terminal_requires_its_own_local_desktop() {
let is_active_root_desktop =
|props: &str, id: &str, display: Option<&str>| match root_desktop_display(
props, id, display,
) {
Some(DisplayCheck::Matched) => true,
None => false,
Some(DisplayCheck::SocketSession { .. }) => panic!("unexpected X11 socket check"),
};
let session = "Id=7\nUser=0\nClass=user\nSeat=seat1\nState=active\nRemote=no";
let hostname = whoami::fallible::hostname().unwrap();
let x11 = format!("{session}\nType=x11\nDisplay={hostname}:0");
assert!(is_active_root_desktop(&x11, "7", Some(":0.0")));
assert!(is_active_root_desktop(&x11, "7", Some("unix/:0.0")));
assert!(!is_active_root_desktop(&x11, "7", Some("tcp/:0")));
assert!(!is_active_root_desktop(&x11, "8", Some(":0")));
assert!(!is_active_root_desktop(&x11, "", Some(":1")));
assert!(!is_active_root_desktop(
&format!("{session}\nType=x11"),
"7",
None
));
let other_host = format!("other.{hostname}:0");
assert!(!is_active_root_desktop(&x11, "7", Some(&other_host)));
let wayland = format!("{session}\nType=wayland");
assert!(is_active_root_desktop(&wayland, "", None));
let greeter = wayland.replace("Class=user", "Class=greeter");
assert!(!is_active_root_desktop(&greeter, "7", None));
// logind during a logout: still the seat's active session, but closing.
let logging_out = wayland.replace("State=active", "Active=yes\nState=closing");
assert!(!is_active_root_desktop(&logging_out, "7", None));
for required in session.lines() {
let missing = wayland.replace(required, "");
assert!(!is_active_root_desktop(&missing, "7", None), "{required}");
}
}
}
+71 -6
View File
@@ -32,6 +32,7 @@ use winapi::{
pub(super) const PRIVACY_MODE_IMPL: &str = super::PRIVACY_MODE_IMPL_WIN_VIRTUAL_DISPLAY;
const CONFIG_KEY_REG_RECOVERY: &str = base::config::keys::OPTION_REG_RECOVERY;
const ADDED_DISPLAY: &str = "added_display";
const STATE_CHECK_LOG_INTERVAL: Duration = Duration::from_secs(60);
fn check_active_displays(displays: impl Iterator<Item = DISPLAY_DEVICEW>) -> ResultType<()> {
@@ -137,6 +138,11 @@ struct Display {
primary: bool,
}
fn decode_display_name(name: &[WCHAR]) -> Result<String, std::string::FromUtf16Error> {
let end = name.iter().position(|&c| c == 0).unwrap_or(name.len());
String::from_utf16(&name[..end])
}
pub struct PrivacyModeImpl {
impl_key: String,
conn_id: i32,
@@ -192,8 +198,7 @@ impl PrivacyModeImpl {
let mut i: DWORD = 0;
loop {
#[allow(invalid_value)]
let mut dd: DISPLAY_DEVICEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
let mut dd: DISPLAY_DEVICEW = unsafe { std::mem::zeroed() };
dd.cb = std::mem::size_of::<DISPLAY_DEVICEW>() as _;
let ok = unsafe { EnumDisplayDevicesW(std::ptr::null(), i, &mut dd as _, 0) };
if ok == FALSE {
@@ -274,7 +279,7 @@ impl PrivacyModeImpl {
fn set_primary_display(&mut self) -> ResultType<String> {
// Multiple virtual displays with different origins are tested.
let display = &self.virtual_displays[0];
let display_name = std::string::String::from_utf16(&display.name)?;
let display_name = decode_display_name(&display.name)?;
#[allow(invalid_value)]
let mut new_primary_dm: DEVMODEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
@@ -601,9 +606,15 @@ impl PrivacyMode for PrivacyModeImpl {
));
let reg_connectivity_2 = reg_display_settings::read_reg_connectivity()?;
if let Some(reg_recovery) =
reg_display_settings::diff_recent_connectivity(reg_connectivity_1, reg_connectivity_2)
{
let registry =
reg_display_settings::diff_recent_connectivity(reg_connectivity_1, reg_connectivity_2);
// Amyuni reports index zero for every monitor. Only a sole display can be identified here.
let added_display = (virtual_display_manager::is_amyuni_idd()
&& !guard.virtual_displays_added.is_empty()
&& guard.virtual_displays.len() == 1)
.then_some(primary_display_name.as_str());
let reg_recovery = display_recovery_value(registry, added_display)?;
if !reg_recovery.is_null() {
Config::set_option(
CONFIG_KEY_REG_RECOVERY.to_owned(),
serde_json::to_string(&reg_recovery)?,
@@ -670,6 +681,30 @@ impl Drop for PrivacyModeImpl {
}
}
fn display_recovery_value(
registry: Option<reg_display_settings::RegRecovery>,
added_display: Option<&str>,
) -> serde_json::Result<serde_json::Value> {
let mut record = serde_json::to_value(registry)?;
if let Some(name) = added_display {
record[ADDED_DISPLAY] = name.into();
}
Ok(record)
}
fn recover_added_display(value: &str) -> ResultType<()> {
if !virtual_display_manager::is_amyuni_idd() {
return Ok(());
}
let mut fields: serde_json::Map<_, _> = serde_json::from_str(value)?;
let display: Option<String> =
serde_json::from_value(fields.remove(ADDED_DISPLAY).unwrap_or_default())?;
if let Some(name) = display {
virtual_display_manager::amyuni_idd::recover_privacy_monitor(&name)?;
}
Ok(())
}
#[inline]
fn reset_config_reg_connectivity() {
Config::set_option(CONFIG_KEY_REG_RECOVERY.to_owned(), "".to_owned());
@@ -682,6 +717,9 @@ pub fn restore_reg_connectivity(plug_out_monitors: bool, force: bool) {
}
if plug_out_monitors {
let _ = virtual_display_manager::plug_out_monitor(-1, true, false);
if let Err(err) = recover_added_display(&config_recovery_value) {
log::error!("Failed to recover the privacy mode display: {err}");
}
}
if let Ok(reg_recovery) =
serde_json::from_str::<reg_display_settings::RegRecovery>(&config_recovery_value)
@@ -698,6 +736,33 @@ mod tests {
use super::*;
use hbb_common::tokio::sync::mpsc::{error::TryRecvError, unbounded_channel};
#[test]
fn display_name_ends_at_the_first_nul() {
let name = r"\\.\DISPLAY2";
let mut buffer: Vec<_> = name.encode_utf16().collect();
buffer.extend([0, 0xd800]);
assert_eq!(decode_display_name(&buffer).unwrap(), name);
}
#[test]
fn display_recovery_preserves_legacy_registry_fields() {
let name = "DISPLAY2";
let combined = serde_json::json!({
"path": "monitor", "key": "Recent", "old": [[1], 3], "new": [[2], 3],
"added_display": name
});
let registry = serde_json::from_value(combined.clone()).unwrap();
assert_eq!(
display_recovery_value(Some(registry), Some(name)).unwrap(),
combined
);
assert_eq!(
display_recovery_value(None, Some(name)).unwrap(),
serde_json::json!({"added_display": name})
);
assert!(display_recovery_value(None, None).unwrap().is_null());
}
#[test]
fn privacy_mode_checks_active_displays() {
let virtual_name = virtual_display_manager::get_cur_device_string();
+3 -1
View File
@@ -48,6 +48,7 @@ fn connection_meta(
ConnectionMeta {
control_permissions,
controlled_context,
..Default::default()
}
}
@@ -1533,7 +1534,7 @@ async fn udp_nat_listen(
peer_addr: SocketAddr,
peer_addr_v4: SocketAddr,
server: ServerPtr,
meta: ConnectionMeta,
mut meta: ConnectionMeta,
slot: PunchSlot,
) -> ResultType<()> {
let tm = Instant::now();
@@ -1550,6 +1551,7 @@ async fn udp_nat_listen(
// The KCP session is up: from here it is a connection like any other and the connection
// layer's own limits apply to it, so the place goes back for the next punch.
drop(slot);
meta.is_kcp = true;
crate::server::create_tcp_connection(server, stream.1, peer_addr_v4, true, meta).await?;
Ok(())
};
+1
View File
@@ -90,6 +90,7 @@ type ConnMap = HashMap<i32, ConnInner>;
pub struct ConnectionMeta {
pub control_permissions: Option<ControlPermissions>,
pub controlled_context: Option<ControlledContext>,
pub is_kcp: bool,
}
#[cfg(any(target_os = "macos", target_os = "linux"))]
+215 -22
View File
@@ -75,6 +75,8 @@ use windows::Win32::Foundation::{CloseHandle, HANDLE};
use crate::virtual_display_manager;
pub type Sender = mpsc::UnboundedSender<(Instant, Arc<Message>)>;
#[cfg(target_os = "linux")]
mod linux_terminal;
mod trusted_devices;
const FAILURE_IDX_ID_WHITELIST: usize = 2;
@@ -226,6 +228,15 @@ fn constant_time_eq(a: &[u8], b: &[u8]) -> bool {
x == 0
}
async fn wait_for_peer_close(stream: &mut Stream, is_kcp: bool) {
// KCP uses a loopback TCP stream and can wait until the timeout when its endpoint stops.
let timeout_secs = if is_kcp || stream.is_webrtc() { 1 } else { 10 };
let _ = time::timeout(Duration::from_secs(timeout_secs), async {
while let Some(Ok(_)) = stream.next().await {}
})
.await;
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
fn should_use_terminal_os_login_scope(is_terminal: bool, os_login_username: &str) -> bool {
cfg!(target_os = "windows") && is_terminal && !os_login_username.trim().is_empty()
@@ -355,10 +366,10 @@ impl TerminalUserToken {
}
}
}
pub struct Connection {
pub struct Connection<'a> {
inner: ConnInner,
display_idx: usize,
stream: super::Stream,
stream: &'a mut Stream,
server: super::ServerPtrWeak,
hash: Hash,
read_jobs: Vec<fs::TransferJob>,
@@ -436,6 +447,7 @@ pub struct Connection {
#[cfg(not(any(target_os = "ios")))]
pressed_modifiers: HashSet<rdev::Key>,
closed: bool,
sent_final_message: bool,
#[cfg(not(any(target_os = "android", target_os = "ios")))]
start_cm_ipc_para: Option<StartCmIpcPara>,
auto_disconnect_timer: Option<(Instant, u64)>,
@@ -529,18 +541,41 @@ fn drm_can_serve_login_screen() -> bool {
false
}
impl Connection {
impl Connection<'_> {
pub async fn start(
addr: SocketAddr,
stream: super::Stream,
mut stream: super::Stream,
id: i32,
server: super::ServerPtrWeak,
meta: super::ConnectionMeta,
unauthorized: UnauthorizedID,
) {
// The admission place stays held while the transport drains, unless a newer
// connection needs it.
let is_kcp = meta.is_kcp;
let (wait_for_close, unauthorized) =
Self::_start(addr, &mut stream, id, server, meta, unauthorized).await;
if wait_for_close {
// Only the transport is needed here. Session cleanup must not wait for the peer.
tokio::select! {
_ = wait_for_peer_close(&mut stream, is_kcp) => {}
_ = unauthorized_evicted(&unauthorized) => {}
}
}
}
async fn _start(
addr: SocketAddr,
stream: &mut Stream,
id: i32,
server: super::ServerPtrWeak,
meta: super::ConnectionMeta,
unauthorized: UnauthorizedID,
) -> (bool, Option<UnauthorizedID>) {
let super::ConnectionMeta {
control_permissions,
controlled_context,
is_kcp,
} = meta;
// Android is not supported yet, so we always set control_permissions to None.
#[cfg(target_os = "android")]
@@ -570,7 +605,7 @@ impl Connection {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
let tx_cloned = tx.clone();
let mut conn = Self {
let mut conn = Connection {
inner: ConnInner {
id,
tx: Some(tx),
@@ -645,6 +680,7 @@ impl Connection {
#[cfg(not(any(target_os = "ios")))]
pressed_modifiers: Default::default(),
closed: false,
sent_final_message: false,
#[cfg(not(any(target_os = "android", target_os = "ios")))]
start_cm_ipc_para: Some(StartCmIpcPara {
rx_to_cm,
@@ -676,7 +712,7 @@ impl Connection {
conn.closed = true;
// sleep to ensure msg got received.
sleep(1.).await;
return;
return (false, None);
}
#[cfg(target_os = "android")]
start_channel(rx_to_cm, tx_from_cm);
@@ -743,6 +779,7 @@ impl Connection {
(_tx_clip, rx_clip) = mpsc::unbounded_channel::<i32>();
}
let mut manual_disconnect = false;
loop {
tokio::select! {
// biased; // video has higher priority // causing test_delay_timer failed while transferring big file
@@ -774,6 +811,7 @@ impl Connection {
ipc::Data::Close => {
conn.chat_unanswered = false; // seen
conn.file_transferred = false; //seen
manual_disconnect = true;
conn.send_close_reason_no_retry("").await;
conn.on_close("connection manager", true).await;
break;
@@ -1073,7 +1111,7 @@ impl Connection {
_ = conn.file_timer.tick() => {
if !conn.read_jobs.is_empty() {
conn.send_to_cm(ipc::Data::FileTransferLog(("transfer".to_string(), fs::serialize_transfer_jobs(&conn.read_jobs))));
match fs::handle_read_jobs(&mut conn.read_jobs, &mut conn.stream).await {
match fs::handle_read_jobs(&mut conn.read_jobs, conn.stream).await {
Ok(log) => {
if !log.is_empty() {
conn.send_to_cm(ipc::Data::FileTransferLog(("transfer".to_string(), log)));
@@ -1090,6 +1128,7 @@ impl Connection {
}
Ok(conns) = hbbs_rx.recv() => {
if conns.contains(&id) {
manual_disconnect = true;
conn.send_close_reason_no_retry("Closed manually by web console").await;
conn.on_close("web console", true).await;
break;
@@ -1170,7 +1209,7 @@ impl Connection {
Some(data) = rx_from_authed.recv() => {
match data {
ipc::Data::Close => {
conn.send(crate::common::make_privacy_mode_msg(
conn.send_before_close(crate::common::make_privacy_mode_msg(
back_notification::PrivacyModeState::PrvOnByOther,
String::new(),
)).await;
@@ -1282,6 +1321,10 @@ impl Connection {
}
conn.on_close("End", true).await;
log::info!("#{} connection loop exited", id);
(
conn.should_wait_for_peer_close(is_kcp, manual_disconnect),
conn.unauthorized_id.take(),
)
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
@@ -1447,7 +1490,7 @@ impl Connection {
async fn check_privacy_mode_on(&mut self) -> bool {
if privacy_mode::is_in_privacy_mode() {
self.send_login_error("Someone turns on privacy mode, exit")
self.send_login_error_before_close("Someone turns on privacy mode, exit")
.await;
false
} else {
@@ -1495,13 +1538,15 @@ impl Connection {
self.decay_id_whitelist_failures();
let (failure, res) = self.check_failure(FAILURE_IDX_ID_WHITELIST).await;
if !res {
// check_failure sent the error; its other callers keep the connection open.
self.sent_final_message = true;
return false;
}
if id_whitelist_allows(&id_whitelist, &self.lr.my_id) {
return true;
}
self.update_failure(failure, false, FAILURE_IDX_ID_WHITELIST);
self.send_login_error("Your ID is blocked by the peer")
self.send_login_error_before_close("Your ID is blocked by the peer")
.await;
self.post_alarm_audit(
AlarmAuditType::IdWhitelist,
@@ -1839,7 +1884,7 @@ impl Connection {
return true;
};
if pf.multiplex {
crate::port_forward_mux::cap_packet_size(&mut self.stream);
crate::port_forward_mux::cap_packet_size(self.stream);
// `inner.tx` is set for the connection's whole life; `None` here is
// unreachable, and refusing the login is the only honest answer.
self.port_forward_mux = self.inner.tx.clone().map(|tx| {
@@ -1860,7 +1905,7 @@ impl Connection {
if is_rdp {
addr = "RDP".to_owned();
}
self.send_login_error(format!(
self.send_login_error_before_close(format!(
"Failed to access remote {}. Please make sure it is reachable/open.",
addr
))
@@ -1872,7 +1917,7 @@ impl Connection {
if is_rdp {
addr = "RDP".to_owned();
}
self.send_login_error(format!(
self.send_login_error_before_close(format!(
"Failed to access remote {}. Please make sure it is reachable/open.",
addr
))
@@ -2492,6 +2537,24 @@ impl Connection {
self.send(msg_out).await;
}
async fn send_login_error_before_close<T: std::string::ToString>(&mut self, err: T) {
let mut msg_out = Message::new();
let mut res = LoginResponse::new();
res.set_error(err.to_string());
res.trusted_device_v2_supported =
self.lr.trusted_device_v2_supported && self.trusted_device.is_some();
msg_out.set_login_response(res);
self.send_before_close(msg_out).await;
}
/// For the last message before the connection closes, so WebRTC and KCP get to deliver it.
async fn send_before_close(&mut self, msg: Message) {
match self.stream.send(&msg).await {
Ok(()) => self.sent_final_message = true,
Err(err) => log::debug!("Failed to send the last message before closing: {err}"),
}
}
#[inline]
pub fn send_block_input_error(
s: &Sender,
@@ -2904,7 +2967,8 @@ impl Connection {
Self::login_scope_kind(&self.lr),
Self::login_scope_kind(lr),
);
self.send_login_error("Connection not allowed").await;
self.send_login_error_before_close("Connection not allowed")
.await;
false
}
Some(_) => true,
@@ -3059,7 +3123,7 @@ impl Connection {
if !crate::common::is_direct_ip_access(&lr.username) && lr.username != Config::get_id()
{
self.send_login_error(crate::client::LOGIN_MSG_OFFLINE)
self.send_login_error_before_close(crate::client::LOGIN_MSG_OFFLINE)
.await;
return false;
}
@@ -3227,7 +3291,8 @@ impl Connection {
log::warn!(
"Rejected switch sides response for non-remote-desktop session; closing connection"
);
self.send_login_error("Connection not allowed").await;
self.send_login_error_before_close("Connection not allowed")
.await;
return false;
}
self.reset_session_scope_for_login();
@@ -4209,7 +4274,7 @@ impl Connection {
true
}
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[cfg(target_os = "macos")]
fn fill_terminal_user_token(
&mut self,
_username: &str,
@@ -4339,6 +4404,7 @@ impl Connection {
);
// Terminal OS login is sensitive. Close this connection instead of keeping it
// alive for retries on the same socket after a rate-limit block.
self.sent_final_message = true;
return Some(false);
}
TerminalAuthorizationMode::OsLogin {
@@ -4355,9 +4421,12 @@ impl Connection {
TerminalAuthorizationMode::SessionUser => FailureScope::Default,
};
let username = normalized_username;
let password = self.lr.os_login.password.clone();
#[cfg(target_os = "linux")]
let terminal_login_error = linux_terminal::fill_token(&mut self.terminal_user_token).await;
#[cfg(not(target_os = "linux"))]
let terminal_login_error = {
let username = normalized_username;
let password = self.lr.os_login.password.clone();
#[cfg(target_os = "windows")]
{
// Concurrency gate for terminal OS login with credentials, to prevent brute-force attacks.
@@ -4402,6 +4471,15 @@ impl Connection {
} else {
"Terminal session-user authorization"
};
#[cfg(target_os = "linux")]
hbb_common::throttled_log!(
linux_terminal::LOG_INTERVAL,
warn,
"{auth_context} failed: ip={} conn_id={} scope={failure_scope:?} msg='{msg}'",
self.ip,
self.inner.id()
);
#[cfg(not(target_os = "linux"))]
log::warn!(
"{} failed: ip={} conn_id={} scope={:?} msg='{}'",
auth_context,
@@ -5491,6 +5569,15 @@ impl Connection {
}
}
fn should_wait_for_peer_close(&self, is_kcp: bool, manual_disconnect: bool) -> bool {
// The controller or relay may still be writing when an active session is disconnected.
let wait_for_manual_close = manual_disconnect
&& self.authorized
&& matches!(self.stream, Stream::Tcp(_) | Stream::WebSocket(_));
// Dropping WebRTC or KCP can discard a queued final message.
self.sent_final_message && (is_kcp || self.stream.is_webrtc() || wait_for_manual_close)
}
// The `reason` should be consistent with `check_if_retry` if not empty
async fn send_close_reason_no_retry(&mut self, reason: &str) {
let mut misc = Misc::new();
@@ -5501,7 +5588,10 @@ impl Connection {
}
let mut msg_out = Message::new();
msg_out.set_misc(misc);
self.send(msg_out).await;
match self.stream.send(&msg_out).await {
Ok(()) => self.sent_final_message = true,
Err(err) => log::debug!("Failed to send CloseReason: {err}"),
}
raii::AuthedConnID::check_remove_session(self.inner.id(), self.session_key());
}
@@ -6910,7 +7000,7 @@ impl Default for PortableState {
}
}
impl Drop for Connection {
impl Drop for Connection<'_> {
fn drop(&mut self) {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
self.release_pressed_modifiers();
@@ -7386,6 +7476,109 @@ mod test {
UNAUTHORIZED_CONNS.lock().unwrap().len()
}
#[tokio::test]
async fn tcp_upload_receives_manual_disconnect_reason() {
use hbb_common::{bytes::Bytes, futures::stream};
let reason = "Closed manually by the peer";
let block = fs::new_block(FileTransferBlock {
data: vec![0; 128 * 1024].into(),
..Default::default()
});
let upload_block = Bytes::from(block.write_to_bytes().unwrap());
// A queued close reason can beat the reset even without the wait. Exercise several connections.
for _ in 0..4 {
let (mut controlled, mut controller, _) = stalled_incoming().await;
let block = &block;
let host = async move {
controlled.next().await.unwrap().unwrap();
controlled.send(block).await.unwrap();
let close = misc_msg(|m| m.set_close_reason(reason.into()));
controlled.send(&close).await.unwrap();
wait_for_peer_close(&mut controlled, false).await;
};
let upload_block = upload_block.clone();
let client = async move {
let Stream::Tcp(tcp) = &mut controller else {
unreachable!("expected loopback TCP");
};
let (writer, mut reader) = (&mut tcp.0).split();
let upload = stream::repeat(upload_block).map(Ok).forward(writer);
let receive = async {
reader.next().await.unwrap().unwrap(); // File data queued ahead of CloseReason.
let frame = reader
.next()
.await
.expect("EOF before CloseReason")
.unwrap();
let message = Message::parse_from_bytes(&frame).unwrap();
assert_eq!(message.misc().close_reason(), reason);
};
tokio::select! {
result = upload => panic!("upload ended before CloseReason: {result:?}"),
() = receive => {}
}
};
timeout(5_000, async { tokio::join!(host, client) })
.await
.unwrap();
}
}
#[tokio::test]
async fn webrtc_controller_receives_manual_disconnect_reason() {
use hbb_common::webrtc::WebRTCStream;
let (mut controller, mut controlled) = timeout(30_000, async {
let offerer = WebRTCStream::new("", false, 20000).await.unwrap();
let offer = offerer.get_local_endpoint().await.unwrap();
let answerer = WebRTCStream::new(&offer, false, 20000).await.unwrap();
let answer = answerer.get_local_endpoint().await.unwrap();
offerer.set_remote_endpoint(&answer).await.unwrap();
(Stream::WebRTC(offerer), Stream::WebRTC(answerer))
})
.await
.expect("WebRTC setup timed out");
let reason = "Closed manually by the peer";
let message = misc_msg(|m| m.set_close_reason(reason.into()));
let ping = msg(|m| m.set_test_delay(TestDelay::new()));
controller.send(&ping).await.unwrap();
controlled.send(&message).await.unwrap();
let reader = tokio::spawn(async move {
time::sleep(Duration::from_millis(100)).await;
let frame = controller.next_timeout(3000).await.expect("close reason");
Message::parse_from_bytes(&frame.unwrap()).unwrap()
});
wait_for_peer_close(&mut controlled, false).await;
drop(controlled);
assert_eq!(reader.await.unwrap().misc().close_reason(), reason);
}
#[tokio::test]
async fn kcp_controller_receives_manual_disconnect_reason() {
let ((_controller_guard, mut controller), (controlled_guard, mut controlled)) =
crate::kcp_stream::tests::establish().await;
let reason = "Closed manually by the peer";
let sender = tokio::spawn(async move {
let message = misc_msg(|m| m.set_close_reason(reason.into()));
controlled.send(&message).await.unwrap();
wait_for_peer_close(&mut controlled, true).await;
drop(controlled);
drop(controlled_guard);
});
let frame = controller
.next_timeout(3000)
.await
.expect("close reason")
.unwrap();
let message = Message::parse_from_bytes(&frame).unwrap();
assert_eq!(message.misc().close_reason(), reason);
drop(controller);
sender.await.unwrap();
}
#[test]
fn test_ip_whitelist_entries_ignore_spaces_around_them() {
let entries = ip_whitelist_entries("192.168.1.0/24, 10.0.0.1 ");
@@ -7430,7 +7623,7 @@ mod test {
.await
.unwrap();
let host = listener.local_addr().unwrap().to_string();
let controller = hbb_common::socket_client::connect_tcp(host, 3000)
let controller = hbb_common::socket_client::connect_tcp_local(host, None, 3000)
.await
.unwrap();
let (accepted, addr) = listener.accept().await.unwrap();
+54
View File
@@ -0,0 +1,54 @@
use super::TerminalUserToken;
use hbb_common::ResultType;
pub(super) const LOG_INTERVAL: std::time::Duration = std::time::Duration::from_secs(60);
const DESKTOP_REQUIRED: &str = "Remote terminal access requires an active desktop session";
pub(super) async fn fill_token(token: &mut Option<TerminalUserToken>) -> Option<&'static str> {
apply_session_check(token, crate::platform::linux::terminal::is_allowed().await)
}
fn apply_session_check(
token: &mut Option<TerminalUserToken>,
result: ResultType<bool>,
) -> Option<&'static str> {
let error = match result {
Ok(true) => None,
Ok(false) => Some(DESKTOP_REQUIRED),
Err(err) => {
hbb_common::throttled_log!(
LOG_INTERVAL,
warn,
"Could not verify the root terminal session: {err:#}"
);
Some("Failed to get user token.")
}
};
*token = error.is_none().then_some(TerminalUserToken::SelfUser);
error
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn only_an_allowed_session_gets_a_token() {
let mut token = None;
assert_eq!(apply_session_check(&mut token, Ok(true)), None);
assert!(matches!(token, Some(TerminalUserToken::SelfUser)));
assert_eq!(
apply_session_check(&mut token, Ok(false)),
Some(DESKTOP_REQUIRED)
);
assert!(token.is_none());
let mut token = Some(TerminalUserToken::SelfUser);
let fault = Err(hbb_common::anyhow::anyhow!("logind unavailable"));
assert_eq!(
apply_session_check(&mut token, fault),
Some("Failed to get user token.")
);
assert!(token.is_none());
}
}
+4 -4
View File
@@ -6,7 +6,7 @@ use crate::trusted_devices::{
};
use base::message_proto::LoginResponse;
impl Connection {
impl Connection<'_> {
pub(super) async fn begin_trusted_device(&mut self) -> bool {
if self.conn_audit_primary_auth != ConnAuditPrimaryAuth::PermanentPassword
|| (!self.stream.is_secured() && !crate::common::is_direct_ip_access(&self.lr.username))
@@ -36,7 +36,7 @@ impl Connection {
}
Ok(None) => true,
Err(error) => {
self.send_login_error(error).await;
self.send_login_error_before_close(error).await;
false
}
}
@@ -54,7 +54,7 @@ impl Connection {
return true;
}
self.trusted_device = None;
self.send_login_error(error).await;
self.send_login_error_before_close(error).await;
self.on_close("Trusted-device authentication failed", false)
.await;
return false;
@@ -91,7 +91,7 @@ impl Connection {
host::log_unavailable(&error);
return true;
}
self.send_login_error(error).await;
self.send_login_error_before_close(error).await;
self.on_close("Trusted-device enrollment failed", false)
.await;
false
+1 -1
View File
@@ -1,5 +1,5 @@
use super::*;
use hbb_common::{allow_err, anyhow};
use hbb_common::anyhow;
use base::platform::linux::DISTRO;
use scrap::{
is_cursor_embedded, set_map_err,
+36
View File
@@ -937,6 +937,29 @@ pub mod amyuni_idd {
Ok(())
}
fn should_unplug_privacy_monitor(name: &str, active: &[String]) -> ResultType<bool> {
let found = active
.iter()
.any(|device| windows::is_device_name(device, name));
// The Amyuni unplug request takes no monitor identifier.
if found && active.len() > 1 {
bail!("Cannot select {name} among multiple active Amyuni displays");
}
Ok(found)
}
pub(crate) fn recover_privacy_monitor(name: &str) -> ResultType<()> {
let active = windows::get_device_names(Some(super::AMYUNI_IDD_DEVICE_STRING));
if !should_unplug_privacy_monitor(name, &active)? {
return Ok(());
}
plug_monitor_(false, Some(PRIVACY_MONITOR_TIMEOUT))?;
if is_my_display(name) {
bail!("Privacy mode display {name} is still attached");
}
Ok(())
}
#[inline]
pub fn get_monitor_count() -> usize {
windows::get_device_names(Some(super::AMYUNI_IDD_DEVICE_STRING)).len()
@@ -954,6 +977,19 @@ pub mod amyuni_idd {
use super::*;
use std::sync::mpsc::{channel, RecvTimeoutError};
#[test]
fn restart_unplugs_only_the_recorded_amyuni_display() {
let saved = r"\\.\DISPLAY2";
let display = format!("{saved}\0");
let other = String::from("\\\\.\\DISPLAY3\0");
let should_unplug = |active: &[String]| should_unplug_privacy_monitor(saved, active);
assert!(should_unplug(std::slice::from_ref(&display)).unwrap());
assert!(!should_unplug(&[]).unwrap());
assert!(!should_unplug(std::slice::from_ref(&other)).unwrap());
assert!(!should_unplug(&[other.clone(), String::from("\\\\.\\DISPLAY4\0")]).unwrap());
assert!(should_unplug(&[display, other]).is_err());
}
#[test]
fn privacy_preparation_waits_and_can_be_cancelled() {
const PENDING_CHECK: Duration = Duration::from_millis(100);