Repository navigation
Don't wire a click to open a received .desktop file - #14853
namespaceMarcello wants to merge 5 commits into
Conversation
A Taildrop sender chooses both the name and the contents of the file it sends. The arrival notification carried --exec xdg-open "$path" for every file, so a single click could hand a received .desktop launcher to xdg-open; on a desktop that honors launchers that runs its Exec line. Announce a received .desktop the same way, but without the click-to-open action, so taking delivery of one is never a step toward running it. Every other file type is unchanged. Validation: test/shell tailscale-receive — a received evil.desktop is announced but gets no --exec xdg-open; reverting the guard turns that assertion red. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
[Low impact] The PR appears safe to merge within its stated filename-only scope. SummaryReceived files whose names end in
Reviews (4) · Last reviewed commit: "Merge quattro into the Taildrop launcher..." · Reviewed by Greptile |
The guard already lowercases the name before matching (${name,,} ==
*.desktop), so a mixed-case launcher like Trap.DESKTOP is held back, but
no test proved it. Add that case next to evil.desktop: it is announced
and gets no --exec xdg-open.
Validation: test/shell tailscale-receive — 12 checks pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for this. I read the change to Nothing is waiting on you. It goes round again once a second opinion is available, and then it gets the full check: a reproduction on a worker against |
Since this branch was cut, omacom#15326 moved the Taildrop arrival notice's text to omarchy-i18n and omacom#13353 gave every file the glyph instead of an image preview; the click still opens the file with xdg-open, a .desktop included. The guard merges cleanly onto the new notice. omacom#13353's test reads the busctl call the notice makes, so the two .desktop cases are redone in that form: assert_notification takes --no-open and checks that the toast carries no omarchy-exec-argv hint and no copy of the path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Tailscale panel README says a click on the arrival notice opens the file. A received .desktop launcher is announced without that click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omacom#16301 added image previews and the send glyph to the receive toast, and omacom#16561 named the app so files stack. The .desktop guard merged cleanly below them; in the test, keep quattro's glyph and preview checks and this branch's --no-open check, and in the panel README add the launcher clause to the new sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omarchy-tailscale-receiveannounces each arriving Taildrop file with a notification whose click opens the file throughomarchy-notification-send ... --exec xdg-open "$path". A Taildrop sender chooses both the name and the contents of what it sends, and a.desktopentry is an application launcher: where something that runs launchers handles it, opening one runs itsExec=line.This keeps the announcement but drops the click for a received file whose name ends in
.desktop, in any case. The file is still saved and announced with the same glyph, urgency and text as any other, so it can be looked at. Every other file is announced exactly as onquattro: an image preview for images, the send glyph otherwise, and a click that runsxdg-openon it.#16301 previews received images because Taildrop only accepts files from the user's own devices. A
.desktopis a different case from an image: opening one runs a command instead of showing a picture, so a launcher sent from one compromised device would otherwise be one click from running on the others.This is defense in depth with a narrow reach, and its limits are worth stating plainly:
XDG_CURRENT_DESKTOP=Hyprland,default/hypr/envs.lua:21)xdg-openruns in its generic mode and types the file withfile(1), which reads a desktop entry astext/plain, so the click hands it to the text editor (text/plain=nvim.desktop,default/applications/mimeapps.list:33), never to a launcher. Omarchy sets noapplication/x-desktophandler, and Nautilus being installed does not change whatxdg-opendoes here.xdg-opentypes files from the shared MIME database (withperl-file-mimeinfo, which Make xdg-open pick file types by name, like the file manager #14854 proposes for the base set) and something that runs launchers handlesapplication/x-desktop. Even withperl-file-mimeinfoand no such handler, a received.desktopopens as text. Whether such a handler exists depends on what the user installs; the guard does not rely on it either way.notes,x.kdelnk, or the receiver's own.desktop-1when a second bare.desktoparrives) keeps its click.Closing that last gap would mean reading the first bytes of each received file for
[Desktop Entry], as shared-mime-info does, before deciding on the click. That reads untrusted content on arrival, a different trade-off from a name check, so it is left out here. If it is wanted, it is a short addition to this PR.Validation:
test/shell.d/tailscale-receive-test.shreads thebusctlcall the notice makes.evil.desktopandTrap.DESKTOPare saved and announced with the send glyph, critical urgency and the same text as any other file, and theirNotifycall carries noomarchy-exec-argvhint and no copy of the path. Upstream's assertions for the other files (image preview over the send glyph, the literal["xdg-open", path]click, spaced names, the collision rename, localized text) are unchanged and pass. Turning the guard off turnstaildrop receive wires no click to a received launcherred onevil.desktop; dropping only the lowercasing turns it red onTrap.DESKTOP; dropping the announcement or giving the.desktopa different click command also turns the test red. Run side by side on 29 names (spaces,--exec,$(…), quotes, unicode, near-misses such asx.desktop.txtandx.DESKTOP.png), this receiver andquattro's make byte-identicalbusctlcalls for every name the guard does not match../test/allin an Arch container after mergingquattro81fd2d2: 6395 passing checks, 69 skipped, 4 failing, and those 4 fail the same way onquattroin the same container. Thexdg-openbehaviour above was measured in that container with Hyprland'sXDG_CURRENT_DESKTOPand stand-in handlers.Updated 2026-10-19: merged
quattro(#15326 and #13353 rewrote the notice and its test). The guard is unchanged, the two.desktopcases are redone in the new test form, and the panel README notes the exception. This description is corrected too: the earlier one said Omarchy ships no file manager, which is wrong (Nautilus is in the base set).Updated 2026-10-25: merged
quattroat 2fca7fe. #16301 brought image previews back with the send glyph and #16561 names the app so a batch stacks; the guard sits below them unchanged, so a.desktopgets neither a preview nor a click. In the test, upstream's glyph and preview checks stay and the--no-opencase is added beside them, and the README sentence on previews gets the launcher clause. After the mergetailscale-receive-test.shpasses (11 checks), the four broken variants above turn it red, and thei18n-checksteps pass (I18N_STRUCTURAL=1 bash test/shell.d/i18n-test.sh, 402 ok;scripts/i18n-sync.py extract-scan --check, no candidates).Written by Claude Code (AI assistant) on behalf of @namespaceMarcello, who directs this work.
🤖 Generated with Claude Code