Commit Graph
11687 Commits
Author SHA1 Message Date
rustdeskandClaude Opus 5.5 333bfc6427 Initialize libsodium where Android starts the server
Started at boot, MainService calls startServer with no Flutter engine,
so initialize never ran: the server worked with libsodium uninitialized
until the UI opened, and that first sodium_init() could land while
sessions were running. startServer now makes the call first, before it
verifies the custom client's signature or spawns the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
2026-11-17 10:48:58 +08:00
rustdeskandClaude Opus 5.5 289f839646 Log a failed libsodium initialization and start anyway
As hbbs does: a client that does not start is worse than one that
runs with libsodium as it was before this change, and sodium_init()
fails only when it cannot lock its own mutex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
2026-11-17 10:47:06 +08:00
rustdeskandClaude Fable 5.2 3dd95ab73b Initialize libsodium before anything uses it
The client called sodium_init() only when the update signature check
or the trusted device token first ran. That call also chooses
libsodium's implementations: where a build has both, it moves Poly1305
from the default one to the SSE2 one, whose state is laid out
differently, so a secretbox or AEAD operation another thread was in
the middle of finished under the other implementation. In one thread,
a computation straddling the call gives a wrong tag. The call now runs
once at process start: first in global_init, which core_main begins
with, and at the top of the FFI initialize, which on mobile verifies a
signature before it reaches global_init.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
2026-11-17 10:42:46 +08:00
fufesou 3e953e886a fix: win, reg update, check (#17040)
* fix(security): prevent privilege escalation via registry recovery (ZDI-CAN-34805)

Validate all registry recovery inputs before accessing HKEY_LOCAL_MACHINE:
  - Path must start with the graphics drivers connectivity prefix
  - Key name must be exactly "Recent"
  - Subkey cannot contain path separators, dots, or null bytes
  - Old and new values must match in type and length

Validation applies unconditionally to both force=false and force=true paths,
blocking arbitrary registry writes from low-privilege IPC clients.

Maintain existing recovery lifecycle and config persistence. Add three
regression tests covering the reported attack vector and data validation.

Reported-by: BoGeun Jang <TrendAI Zero Day Initiative>
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve registry recovery behavior

Restore historical type conversion and force behavior while retaining registry target validation. Replace format restrictions with a regression test for variable-length recovery records.

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

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 17:30:15 +08:00
fufesou bca767fcdb fix(terminal): background opacity, 1.0 (#17075)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 16:38:35 +08:00
github-actions[bot] 5b937c3a68 chore: update webpki-roots to latest Mozilla root store (#17074)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-16 12:29:21 +08:00
RustDesk 7949eca16c fix(android): enforce keyboard permission for remote input (#17061) 2026-11-15 22:58:36 +08:00
RustDeskandClaude Opus 5.5 506e111460 fix(android): sync input service state to enable-keyboard without the UI (#17064)
* Sync the Android input service state to enable-keyboard from Kotlin

enable-keyboard mirrors whether InputService is running, but only the
Flutter UI updated it. When the service was turned on from system
settings while the UI was not running, the option stayed N and new
connections were denied keyboard permission until the app was opened.

InputService now reports its state directly, and MainService reports it
again once startServer has set the config directory.

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

* Stop the Android UI from resetting enable-keyboard on start

ServerModel set enable-keyboard to N on every mobile UI start and relied
on the input state message to set it back. Until that message arrived,
open connections lost keyboard permission. Android now keeps the option
in step with InputService natively, so keep the reset on iOS only.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:58:13 +08:00
RustDeskandClaude Opus 5.5 fcb485bb90 Ignore keyboard and clipboard switches on non-remote connections (#17062)
Android's input control and clipboard toggles call switch_permission_all,
which reaches every CM client. On a file-transfer, view-camera or
port-forward connection, the keyboard switch set keyboard = true and both
switches re-subscribed the clipboard service, so the host's clipboard
changes were sent to a peer that was not granted a remote session.


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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:49:36 +08:00
RustDeskandClaude Opus 5.5 febee50a6e fix: subscribe clipboard services from permission switches only after authorization (#17065)
* Subscribe clipboard services from permission switches only after authorization

Permission toggles in the accept window reach the connection before the
peer is authorized. The keyboard, clipboard and file switches subscribed
the clipboard services at once, so anything the host copied while the
window was open was sent to a peer that had not been accepted.

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

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

* Say "until authorized" in the permission switch comment

The switch arrives after the login request, so "before login" was
inaccurate.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:20:09 +08:00
Maison da Silva fc9713c1b8 Update Portuguese translations for address book and forever (#17038) 2026-11-14 13:05:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev a89a82f911 fix(fs): recognise compressed file extensions in any letter case (#17017)
* fix(fs): recognise compressed file extensions in any letter case

* fix(fs): compare extensions without allocating and trim the test

* test(fs): keep only the uppercase extension checks

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 10:24:40 +08:00
Ruslan ZaitsevandRuslan Zaitsev d4df77e2fd fix(lang): keep the ?key= and @public syntax in the ID field tooltips (#17016)
* fix(lang): keep the ?key= and @public syntax in the ID field tooltips

es and hr translated ?key=, da translated @public, and the Catalan
id_input_tip held the text of a different string. Restore the literal
tokens and clear the Catalan entry so the English tooltip is shown.

* fix(lang): clear the Catalan web ID tooltip and require <id>@public in the test

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 09:03:41 +08:00
Ruslan ZaitsevandRuslan Zaitsev 9cb48e959c fix(remote_printer): declare the winapi features the crate uses (#17018)
Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 08:29:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev e7bacd0358 Add Russian translation of SECURITY.md and update README-RU (#16999)
Add docs/SECURITY-RU.md. In docs/README-RU.md: add the missing languages to the language bar, fix the Docker anchor in the navigation, name the Sciter library in the download instruction, add the libs/base entry to the file structure, and fix a typo.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:33:35 +08:00
d785d7ba2c docs(fr): sync README-FR with the English README (#17012)
- Move the misuse disclaimer to the top and use a valid [!Caution] alert
  ([!Attention] is not a GitHub alert type and rendered as a plain quote)
- Drop the dead #serveurs-publics-libres link from the navigation bar
- Add the missing parts: FAQ and nightly build links, F-Droid and
  Flathub badges (French versions), build guide link (French doc),
  openSUSE section, Flutter/CI note, libs/base, libs/clipboard, flutter
- Update package lists, clone and submodule commands, and screenshots
  to match README.md
- Refresh the language bar and the translation call to action

Signed-off-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:15:11 +08:00
Ruslan ZaitsevandRuslan Zaitsev 6837cb96eb fix(lang): pick the Norwegian translation for no and nn locales (#17010)
The only Norwegian table is nb (Bokmal), but systems also report Norwegian as no (the macrolanguage, e.g. no_NO) or nn (Nynorsk). resolve_lang returned no/nn, which match no table, so the UI fell back to English.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:10:24 +08:00
Ruslan ZaitsevandRuslan Zaitsev 987669e121 fix(lang): use existing translated keys for three UI strings (#17009)
Version: , ID already exists and End call are not keys in src/lang, so they stayed in English in every language. Use the existing Version, Already exists and Stop voice call keys instead, as the desktop settings page, the tag rename check and the controlled side already do.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:32:05 +08:00
Ruslan ZaitsevandRuslan Zaitsev 53a1e8aea4 fix(lang): spell the app name as RustDesk in five translations (#17008)
da, el, es, nl and uk wrote the app name as Rustdesk or RusDesk in nine entries. translate() replaces the exact string RustDesk with a custom client's name, so these spellings showed up unchanged in custom clients (for example the uk About dialog title). Adds a test that fails on master and passes with this change.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:28:50 +08:00
Ruslan ZaitsevandRuslan Zaitsev a7468d0df3 Add Georgian (ka) translation of README (#16997)
Add docs/README-KA.md, translated from the current README.md, and link it from the language bar in README.md.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:33:28 +08:00
Ruslan ZaitsevandRuslan Zaitsev 225ff5721e fix(lang): keep the {} placeholder in three translations (#17000)
* fix(lang): keep the {} placeholder in three translations

fa and nl dropped the {} in shortcut-must-include-modifiers and shortcut-key-not-supported, so the recording dialog lost the modifier list and the rejected key name. sc had a {} and an unrelated meaning in printer-os-requirement-tip, which is shown as plain text.

* test(lang): check fa, nl and sc against the placeholders of their English text

The existing placeholder test only looks at keys that contain {}. These three tables had mismatches against the en.rs text instead (strings whose {} is filled by Dart replaceAll). The test fails on master and passes with the translation fixes.

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:23:31 +08:00
spacemingandluoming b84058e076 fix(linux): forward horizontal wheel events through uinput (#16986)
Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
2026-11-13 09:46:32 +08:00
RustDeskandClaude Opus 5.5 3ccb4c4b5b fix(android): move the log toggle native into ffi.FFI (#16993)
* fix(android): move the log toggle native into ffi.FFI

Custom clients move the Kotlin classes out of com.carriez.flutter_hbb.
DocumentLogs declared setEnabled as a native method, so its export
Java_com_carriez_flutter_1hbb_DocumentLogs_setEnabled did not link
there and the app crashed on start with UnsatisfiedLinkError. The
ffi package keeps its name, so declare the native in ffi.FFI like the
others and call it from DocumentLogs.

Fixes rustdesk/rustdesk-server-pro#1035

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

* ci(android): fail when a JNI native is outside ffi.FFI

Only ffi.FFI survives the package rename custom clients do. Check in
the Android build that every Rust JNI export is Java_ffi_FFI_* and that
no Kotlin file but ffi.kt declares an external fun, and write the rule
down in AGENTS.md.

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

* ci(android): report every JNI rule violation and check class lookups

Run the checks independently so one CI round lists both the Rust and
the Kotlin offenders, and also fail on a Rust lookup of an app class by
name. Note in AGENTS.md that a Kotlin method Rust calls by name needs
@Keep to survive R8.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:02:45 +08:00
RustDesk 1ac53ccb1b Update flutter-build.yml to include keychain-password
Add keychain-password parameter for signing process
2026-11-12 17:18:49 +08:00
RustDesk e8677cb723 fix(linux): preserve maximized layout after minimize and restore (#16988)
* fix(linux): preserve maximized layout after minimize and restore

* ci: skip Linux Flutter tests in release builds
2026-11-12 17:16:08 +08:00
RustDeskandClaude Fable 5.2 66992ab737 clipboard: declare file sizes in the Windows file list (#16240)
* clipboard: declare file sizes in the Windows file list

Pasting files from a Windows peer got slower with the number of files and
then stopped working, while the total size made no difference: one 32 MB
file pasted at once, 45 small files took seconds, and 50 small files
totalling 8.3 MB left the shell spinning and copied nothing.

The sender never set FD_FILESIZE, although it had already read the size and
filled nFileSizeLow/nFileSizeHigh. Without that flag the receiver cannot
trust those fields, so CliprdrStream_New() asks for the size of each file
with its own FILECONTENTS_SIZE request and blocks on the reply for up to
CLIPBOARD_RESPONSE_WAIT_TIMEOUT_SECS. Those streams are all built up front,
in the loop that answers the shell's request for the file group descriptor,
so the round trips run one after another inside IDataObject::GetData() and
the shell waits for every one of them before the paste can begin. The cost
is therefore per file, not per byte, which is what the reports describe.

The size is now declared, and only when it is known: GetFileSizeEx() replaces
GetFileSize(), whose INVALID_FILE_SIZE return cannot be told from a genuine
4GB-1 file without GetLastError(), and directories are skipped because the
handle opened with FILE_FLAG_BACKUP_SEMANTICS above is not a file handle.
A regular file whose size cannot be read is rejected instead of publishing an
ambiguous zero size. This is required because the Unix receiver currently
consumes the descriptor size fields regardless of FD_FILESIZE for
compatibility with older Windows senders.

Upstream FreeRDP, which this file comes from, sets FD_FILESIZE here. It has
been commented out in our copy since the file was first added in 6672087f7,
with no recorded reason; the "for compatibility" note above it was written
later, in 55005f812, about code that already looked this way. The Unix
receiver carries the other half of the same workaround in filetype.rs, where
the size is trusted whether or not the flag is set, explicitly "for
compatibility with Windows".

This is a sender-side fix: the paste gets faster once the machine the files
come from runs it, whichever version does the pasting.

Fixes #16238

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab

* clipboard: fail a size request for an entry that has no size

The descriptor now carries FD_FILESIZE only when the size was actually read,
which leaves both size fields at zero for an entry where it was not. The
non-stream FILECONTENTS_SIZE handler passed those fields straight back, so a
receiver asking about such an entry would be told it is empty and would write a
zero-length file without any error. The previous code returned whatever
GetFileSize() had left behind, which for a failure is INVALID_FILE_SIZE -- also
wrong, but wrong loudly.

Answer only when the descriptor has a size, and fail the request otherwise. The
receiver then fails the paste instead of completing it with an empty file, which
is the same class of outcome the old code produced for that entry.

The IStream_Stat path is unchanged; it already answers from the stream.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab

* clipboard: pass the file count at its C width on 32-bit Windows

HandleClipboardFiles is declared in cliprdr.h as
(UINT32 connID, size_t nFiles, WCHAR **fileNames), but the Rust size_t
alias came from bindgen output generated on x64: c_ulonglong. On i686 the
C caller passes a 4-byte nFiles while the Rust callee reads 8 bytes, so
n_files takes the fileNames pointer as its high half and file_names is read
from the stack slot past the arguments. The first dereference faults and
the process serving the files dies.

The callback fires once per paste, when the audit file is first read, so on
a 32-bit build a paste of files copied there crashes partway. On the
controlled side that process is the connection manager: the server logs
"ipc to connection manager exit: reset by the peer", closes the
connection, and the remaining files fail. 64-bit builds are not affected.
The callback came with #12730, so every 32-bit release since 1.4.2 has
this.

size_t is the only pointer-sized type in these bindings that crosses the
FFI boundary.

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

* clipboard: notify the audit at the first file of a list, not the last

wf_cliprdr_add_to_file_arrays() assigned first_file_index for every
regular file, so it ended up holding the last one, and HandleClipboardFiles
fired when the paste reached the last file rather than when it started. A
paste cancelled before its last file sent no audit record. The Unix owner
in serv_files.rs already takes the first regular file.

Keep the first assignment only. clear_file_array() resets the index to
(size_t)-1 before every list is built.

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

* Revert "clipboard: fail a size request for an entry that has no size"

This reverts commit aba7020834.

The check guarded a state the descriptor change already rules out: a
regular file whose size cannot be read is rejected when the list is built,
so only directories go out without FD_FILESIZE. No receiver asks a
directory for its size: Windows receivers skip directories in
CliprdrStream_New(), and the Unix receivers only send FILECONTENTS_RANGE.
Keep the existing FILECONTENTS_SIZE answer unchanged.

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

* clipboard: reject a file list entry whose attributes cannot be read

GetFileAttributesW() reports failure as INVALID_FILE_ATTRIBUTES, which is
0xFFFFFFFF and so has FILE_ATTRIBUTE_DIRECTORY set. The entry then skipped
the size read and went out as a directory with FD_ATTRIBUTES, and both the
Windows and the Unix receivers created an empty directory where the file
should be, without reporting an error.

Fail the descriptor, as for the other errors here, so the paste fails
instead of losing the file. After this only real directories go out
without FD_FILESIZE.

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

* clipboard: start the audit at the first non-empty file

The audit fires on the first range read of first_file_index. Receivers
never read an empty file: the Windows stream returns S_FALSE once the
offset reaches the declared size, and the macOS and FUSE receivers create
empty files locally. A list that starts with an empty file therefore sent
no audit record at all, while its other files were copied.

Skip empty files when choosing the index. Every regular file in the list
now carries a size that was actually read, so the check is reliable. A
list with no non-empty file still sends no record, as before.

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

* clipboard: do not claim GetFileSize() fails on a directory handle

The comment said so without a check. What matters is that a directory
entry carries no size, whatever its handle would report.

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-12 15:38:12 +08:00
Iain bec9853f0d fix(flutter): show Windows drives when sorting by size or type (#16973)
Signed-off-by: Iain <iain1970@protonmail.com>
2026-11-12 15:37:55 +08:00
RustDesk d46c7c5252 Update flutter-build.yml 2026-11-12 14:22:17 +08:00
RustDesk 420f91f6da Update SIGN_BASE_URL secret reference in workflow 2026-11-12 10:49:45 +08:00
RustDesk 9e24228cd3 Fix SIGN_BASE_URL in flutter-build.yml 2026-11-12 10:27:17 +08:00
rustdesk 95e5bd5023 change to macos-26 runner 2026-11-12 10:09:38 +08:00
MilenandRustDesk 2fe026917d build(vcpkg): vendor the mfx-dispatch cstdint patch in the overlay port (#16961)
* build(vcpkg): vendor the mfx-dispatch cstdint patch in the overlay port

## Problem

The `mfx-dispatch` overlay port downloads its patch from `github.com/<repo>/commit/<sha>.patch`. GitHub answers anonymous downloads of such URLs with HTTP 429 often enough to fail CI runs and local builds.

## Solution

The patch (`git format-patch --full-index` of `lu-zero/mfx_dispatch@d6241243`) is vendored as `res/vcpkg/mfx-dispatch/fix-missing-cstdint-import.patch` and applied from the port directory.

Signed-off-by: Milen Dzhambazov <savemetenminutes@gmail.com>

* build(vcpkg): preserve original mfx-dispatch patch checksum

---------

Signed-off-by: Milen Dzhambazov <savemetenminutes@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-11-11 23:32:34 +08:00
21pages 0bfe22083d feat: allow customizing incoming-only quit button text (#16968) 2026-11-11 17:16:42 +08:00
RustDeskandClaude Opus 5.5 e4368ab119 fix(macos): use a patched default-net 0.22 to fix a launch panic (#16954)
default-net 0.14 casts AF_LINK sockaddrs to a sockaddr_dl struct without
#[repr(C)], so it reads sdl_nlen from past the end of the kernel record
and get_interfaces() panics on some Macs, which aborts RustDesk at launch
(#16950). 0.22 reads the record by byte offset.

Depend on the rustdesk-0.22 branch of rustdesk-org/netdev rather than
crates.io: it is v0.22.0 plus fixes for the panics and memory bugs 0.22
still has on the get_interfaces() path (short link addresses, a double
free and lossy names on Windows, non-UTF-8 names on Unix), and it no
longer looks up the gateway on macOS. netdev, the renamed upstream,
needs Rust 1.85 from 0.38 on. lan.rs is unchanged.


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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:45:20 +08:00
OlegandClaude Opus 5.5 95cca3f661 fix(macos): turn privacy mode off before locking at session end (#16729)
* fix(macos): turn privacy mode off before locking at session end

Most closes call on_close(.., true) from inside the connection loop,
which locks the screen before the loop turns privacy mode off. On macOS
the lock is a Ctrl+Cmd+Q queued on the main queue, and privacy mode's
event tap is torn down on that same queue right after it, so the screen
did not lock and the displays came back on unlocked.

On macOS a connection that owns privacy mode now turns it off before
locking. The macOS lock_screen() also checks that the screen locked
(CGSSessionScreenIsLocked) and presses the shortcut once more if not.

Fixes #15875

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): check the lock once more after the last wait

The retry loop ended its last wait without checking, so a lock that
landed in the final 100 ms pressed the shortcut again or logged a false
"Failed to lock the screen". Wait in platform::wait_locked(), which also
checks at the deadline, and keep the first press as it is on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refact(macos): keep on_close a one-line hook for the turn-off before locking

Move the ownership check and the turn-off into privacy_mode::macos, so
the shared Connection::on_close only calls it, and log a failed turn-off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): turn privacy mode off on the main queue

The blackout monitor, the display reconfiguration callback and the
deferred shutdown lock g_privacyModeMutex on the main thread, while the
turn-off held that mutex and waited for the main queue to tear the event
tap down, so the two could deadlock. The turn-off now runs before the
lock at session end, where a deadlock would also keep the lock from
being requested.

Called off the main thread with privacy mode on, MacSetPrivacyMode(false)
now runs the whole turn-off on the main queue. With privacy mode off it
returns as before, without touching the main queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): leave lock_screen() as on master

Review asked to keep this PR to the ordering fix. Drop the second
press in lock_screen() and the wait_locked() helper it used, so
ordinary macOS lock requests behave as on master again. Privacy mode
is still turned off before the lock at session end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1.5.3
2026-11-09 16:04:24 +08:00
05b9f2d891 fix(flutter): keep Windows accept window side panels on the current monitor (#16855)
* fix(flutter): keep CM side panels on the current Windows monitor

Set the final physical position and size together when toggling CM chat or
file panels. This avoids an intermediate resize crossing into a monitor
with a different DPI before the position is applied.

Limit the change to the Windows CM path and add a positioning regression test.

* fix(flutter): fall back when the CM window screen is unavailable

getWindowInfo() could throw before the side-panel toggle reset its guard,
which locked the chat and file buttons and dropped the incoming message
that opened the panel. A failure now takes the previous setSizeAlignment
path, which also makes the existing no-screen fallback reachable.

The test now starts from the reported setup, the window at the right
edge of a 100% monitor, and checks that each toggle is a single
setBounds, since a resize followed by a move is what crossed monitors.
The 150% case keeps covering the scaled size.

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

* test(flutter): cover CM window info fallback

* Revert "test(flutter): cover CM window info fallback"

This reverts commit 9204e6a021.

---------

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:09:43 +08:00
RustDesk 9a37dfad98 Revert "refact(ci): update, metadata, nightly (#16868)" (#16916)
This reverts commit 79c63639ea.
2026-11-09 00:51:46 +08:00
rustdesk e24e17791a Increase signing wait budget and log timeout task details 2026-11-09 00:27:49 +08:00
rustdesk 78647038b6 inc build number 2026-11-09 00:09:16 +08:00
ceedc314d7 fix: block sensitive config options in strategy updates (#16696)
* fix: block sensitive heartbeat strategy options

Filter 25 sensitive server, trust, authentication, access-control,
deployment and local service settings before merging heartbeat strategy
options. Preserve the existing HTTP protocol, all 27 current server
policy options, and other unblocked options for version compatibility.
Strategy responses remain unauthenticated.

Add regression coverage for blocked writes and clears, including registry
recovery data, and preservation of existing and future policy options.

Tests: cargo test --lib hbbs_http::sync::strategy_tests --locked (2 passed)

* fix: log rejected strategy options and strengthen regression tests

* fix: block trusted-device expiration in strategy updates

A strategy setting it to 0 would make trusted devices skip 2FA forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: block websocket port in heartbeat strategies

* fix: preserve security policy controls in heartbeat strategies

Allow the connection-window and scope-violation policy controls.
Keep enable-trusted-devices blocked because disabling it clears existing
trusted-device grants, which re-enabling does not restore.

* fix: acknowledge heartbeat strategies after application errors

Skipping modified_at after an application error allows the server to
deliver the same strategy version repeatedly. Authentication options
(2FA, trusted-device enablement and expiration) are already blocked,
and the authentication-update path applies unrelated options first.

Keep reporting application errors, but continue processing modified_at
so the failed version is acknowledged. Log "strategy updated" only on
success. Acknowledgement does not guarantee full application; retrying
a failed strategy requires publishing a new version.

Validation: cargo test --lib hbbs_http::sync::strategy_tests --locked
(2 passed; filter coverage only, no live heartbeat verification).

* Revert "fix: acknowledge heartbeat strategies after application errors"

This reverts commit a03d235236.

* test: fix future strategy option spelling

---------

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:51:33 +08:00
rustdeskandClaude Opus 5.5 bd091bc173 fix(dev): stop sciter-rs aborting debug builds on invalid enum values
sciter-rs ORs flags together and transmutes the result back into a
fieldless enum (SCITER_CREATE_WINDOW_FLAGS in WindowBuilder::main_window,
EVENT_GROUPS in default_events, and raw event codes from the engine).
Newer rustc checks enum construction when debug assertions are on, so a
debug build of the Sciter UI aborts on startup with "trying to construct
an enum from an invalid value 0x84". Release builds never had the check.

Turn debug assertions off for sciter-rs in the dev profile only. CI's
Rust 1.75 accepts the override and has no such check, so it is a no-op
there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:06:19 +08:00
rustdesk 09871abd0b 1.5.3 2026-11-08 22:33:56 +08:00
fufesou 3c69194ac4 fix(windows): continue removal after configuration sync errors (#16865)
* fix(windows): continue removal after configuration sync errors

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

* fix(windows): revoke local trust after removal sync errors

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

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 22:28:28 +08:00
RustDeskandClaude Opus 5.5 1ff458bdf3 fix(linux): serve a greetd Wayland login screen over DRM (#16894)
* fix(linux): serve a greetd Wayland login screen over DRM

greetd starts its greeter with no XDG_SESSION_TYPE, so pam_systemd records
the session as Type=tty and the display server reads as x11. is_gdm_user only
knows gdm and sddm, so the DRM login-screen path never engaged at
cosmic-greeter and the greeter's --server captured over X11: a black stream.

Recognize a seat0 session with Class=greeter and Type=tty whose user has a
Wayland socket in /run/user/<uid> as a Wayland login screen, in
is_login_screen_wayland and in Desktop::is_login_wayland, so it takes the path
built for GDM and SDDM greeters. The compositor creates its socket after logind
registers the session, so a greeter first seen without one is asked again on
each refresh. drm builds only; console greeters (tuigreet, agreety) have no
socket and keep their current behavior.

Fixes #16891.

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

* fix(linux): drop the previous session's compositor env at a greetd greeter

Going straight from a user session to a greetd greeter kept that session's
WAYLAND_DISPLAY and bus address in Desktop, and the greeter --server was
started with them: an endpoint it is handed is never searched past, so the
compositor layout lookup failed and the uinput range fell back to the DRM
union. Clear every compositor variable when a greetd greeter is adopted.

Leave a forced display server alone, as IS_X11 and is_x11_for_drm already
do, and log a failing loginctl instead of taking it for "not a greeter" in
silence.

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

* fix(linux): take a greetd greeter for Wayland only from its socket

Type=tty names no display server, and the protocol fallback reads the
service's own XDG_SESSION_TYPE, not the session's. A service that inherited
XDG_SESSION_TYPE=wayland therefore made is_login_wayland() answer yes for a
tty greeter that was never adopted, skipping the socket check and a forced
display server. Start a tty greeter from x11 so only
adopt_wayland_tty_greeter can make it Wayland.

Also log an unexpected error reading the runtime directory; a directory
that does not exist yet stays a silent "no socket".

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

* fix(linux): adopt a greetd greeter when Wayland is forced

adopt_wayland_tty_greeter skipped any forced display server, so with
RUSTDESK_FORCED_DISPLAY_SERVER=wayland the greeter stayed on the x11 path
it now starts from, while its --server was told Wayland. Only a server
forced to x11 is the operator overruling the socket; one forced to Wayland
agrees with it, so adopt the greeter and clear the previous session's
compositor variables as for an unforced one.

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

* fix(linux): keep a greetd greeter off the Wayland login gate when x11 is forced

With RUSTDESK_FORCED_DISPLAY_SERVER=x11, adopt_wayland_tty_greeter leaves a
greetd greeter on the x11 path, but is_login_screen_wayland() still took it
for a Wayland login screen. The login gate in connection.rs then refused the
connection while the DRM verdict was not Available, where master accepted it.
The tty-greeter branch now checks the same override; the GDM/SDDM test is
unchanged.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:10:52 +08:00
21pages 31041137a5 Fix Request approval submenu interactions (#16851)
* fix: add hover behavior to request approval submenus

* fix: use a single hover highlight in legacy popup menus

* fix: avoid duplicate menu tab stops and submenu hover flicker

* fix: skip duplicate focus stops in switch and radio menus

* fix: allow diagonal pointer movement into submenus
2026-11-08 19:15:20 +08:00
Mariano Abad 734273b61c fix(drm): stop re-encoding a still screen (#16888)
* drm: stop repeating an unchanged frame after 3 beats

A still screen sent one identical frame per second for ever (REPEAT_EVERY).
Each of those counts as a real frame in video_service and restarts
static_refresh, so its budget never ran out and the encoder kept re-encoding
the cached frame, about 26 times a second with h264_vaapi. x11 and pipewire
drop a repeat for good.

Send at most MAX_REPEATS (3) repeats after the last new picture. A hardware
encoder switches after 3 failed encodes, so those cover the failed-encode
case the beat is for. A new picture starts the count over.

* drm: notice a new subscriber while the screen is still

Once a still screen has used up its repeats and the static refresh
budget, the WouldBlock arm no longer reaches handle_one_frame or a
static refresh encode, where a subscriber added without a refresh
(the mobile display switch) is noticed. That client got no picture
until the screen changed.

Run the same new-subscriber check at the top of the WouldBlock arm.

* drm: switch for any new subscriber on a still screen

In the WouldBlock arm nothing is sent after the check, so also switch
when the last active subscriber has left and a new one is pending:
the snapshot would promote it with no frame ever following. Log the
expected event at trace level.

* drm: switch for a new subscriber once the encoder has run

Nothing is sent in the WouldBlock arm, so the switch is needed only
when the encoder already produced frames, even if the subscribers
that got them are gone: otherwise the new one gets no keyframe until
the screen changes. A fresh encoder needs no switch. Log the expected
event at trace level.

* drm: leave the new subscriber check in video_service as it was

This reverts the video_service.rs changes of fd872773b, de139dc97 and
ea73ed51f. A subscriber added without a refresh to a still screen is not
specific to drm, so it does not belong in this change.
2026-11-08 18:45:12 +08:00
fufesou 2228db8a10 fix(windows): retry service IPC before terminating the GUI (#16913)
Give the Start service caller one second to arrange its replacement and exit before retrying main IPC startup. Keep this workaround in the server startup thread and preserve the existing termination path when the retry fails.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 16:17:26 +08:00
fufesou 78450f4987 Fix/windows installer directory guard (#16908)
* fix(windows): guard staged installer directories during handoff

Create restrictive staging directories and retain non-delete-sharing handles while CMD consumes packages, scripts and shortcuts. Adapt output paths and cleanup, and add a directory-replacement regression.

Validated with 11 focused Windows tests. Directory protection remains tied to the lifetime of the creating process.

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

* test(windows): streamline installer directory guard tests

Keep installer-file tests in their original inline module and remove the duplicate CMD-copy check from the directory replacement regression. Preserve directory protection and existing handoff coverage.

Validation: Windows library test compilation, four focused tests, rustfmt and git diff --check.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): use plain rd for empty staging directories

Remove the inapplicable /q switch from non-recursive staging-directory cleanup. Keep recursive deletion confined to the runner directory.

Validated with Windows library test compilation, four focused tests and isolated CMD probes for owner termination, nonempty staging directories and exit-code preservation.

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

* test(windows): pin installer staging directory permissions

Check effective ordinary-owner directory rights independently of the sharing guard. Clarify guard lifetime and the Rust and CMD cleanup responsibilities.

Validation: Windows library test compilation, four focused tests, rustfmt and git diff --check.
Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 13:06:43 +08:00
xpehter 3513c9751d fix(audio): look up the named audio input among input devices only (#16906)
get_audio_input() searched HOST.devices(), which lists input and output
devices together, and took the first device whose name matched. CoreAudio
gives a USB microphone with a headphone jack two devices with the same
name, and the output one can come first. RustDesk then picked the output
device, default_input_config() failed with StreamTypeNotSupported, and the
voice call sent no audio from the macOS side ("Failed to get default input
format" every second).

Search HOST.input_devices() instead, so only devices that support input
can match the configured or default input name.

Signed-off-by: xpehter <32315536+xpehter@users.noreply.github.com>
2026-11-07 11:00:14 +08:00
f4c0b13df7 fix(windows): drop the named-pipe installer handoff that F-Secure blocks (#16889)
* fix(windows): drop the named-pipe handoff that F-Secure blocks

Since #16562 the elevated cmd.exe waited on
`set /p RUSTDESK_HANDOFF=<"\\.\pipe\rustdesk-install-<uuid>"` until the
unelevated parent released the staged files' DELETE handles. F-Secure's
behavior detection closes that cmd's end of the pipe, so installation and
Stop service fail with "The pipe is being closed. (0x800700E8)"
(ERROR_NO_DATA) and the BAT never runs (#16840, #16842).

The handles exist only to delete the staged files when UAC is cancelled.
Tampering is prevented by the DACL set at creation, which grants the
unelevated owner read/execute only, and that is unchanged. Release the
handles before launching cmd and run the BAT directly. A cancelled UAC
prompt now leaves the staged BAT and shortcut in the protected directory.

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

* docs(windows): correct the handoff comments after dropping the pipe

The cleanup handle is no longer held through the UAC prompt, and the files
stay protected by their DACLs together with the parent directory's
permissions, not by the DACL alone. Describe the F-Secure failure as what
was observed: cmd's end of the pipe closed before the release signal.

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

* fix(windows): stage installer inputs in guarded directories

Create private staging directories atomically with restrictive ACLs and retained handles that forbid delete sharing. Reuse the existing handle-based cleanup and cover BAT, shortcut and verified-update inputs with Windows regression tests.

Known limitation: terminating the RustDesk caller before CMD exits still releases the directory guards and can leave staging directories behind.

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

* fix(windows): clean up staging directories after batch execution

Remove each batch's own empty staging directories after its files, including when uninstall has terminated the Rust owner. Preserve the installer exit code and cover standalone batch cleanup with a regression test.

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

* test(windows): create protected output directory in handoff test

Exercise the production directory constructor under the retained staging-directory guard while preserving the existing elevated and unelevated assertions.

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

* test(windows): avoid protected installer fixture leftovers

Retain the production directory ACL check with native fixture cleanup. Remove the replacement and handoff tests that leave protected files after unelevated runs.

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

* revert(windows): restore installer handoff to 8ea7251e3

Restore the tracked tree to 8ea7251e35.
Remove the later guarded staging directories and cleanup/test changes,
while retaining the original direct CMD launch without a named pipe.

Reverted changes:
- 6f71c7d3a0
- a188f7b8f1
- d7fb4aff5f
- 6ace789b13

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

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
2026-11-07 00:11:18 +08:00