Repository navigation
fix(linux): preserve XDG executable paths and arguments - #39
Merged
Merged
Conversation
vincentkoc
marked this pull request as ready for review
September 13, 2026 17:47
This was referenced Sep 13, 2026
Owner
|
Thanks for the fix and the thorough testing! Merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XDG autostart currently joins the executable and arguments without quoting. A path containing spaces can fail to start, and spaced or empty arguments lose their boundaries. Quote each literal argument using Desktop Entry string escaping and Exec quoting, including literal percent sequences.
This addresses the XDG portion of #32. Ordinary commands retain their representation; systemd, macOS and Windows implementations and dependencies are unchanged. Production delta is +30 lines for the serializer.
The regression fixture uses
gio launchto start a copied test executable from a path containing spaces, quotes, a backslash, a dollar sign and a backtick. The executable records its exact arguments, including empty values, control whitespace, quotes, percent sequences and Unicode. The test owns a disposable HOME and verifies disable removes the desktop entry.Validation at
cd52eaa3ac2a045a42af8bc24dcc636def861fcc:cargo test --locked --lib --test xdg_execpassed on native Linux (Rust 1.98.1, gio 2.88.0) and FreeBSD 15.1-p3 (Rust 1.98.1, gio 2.88.3): three unit tests, zero ignored tests, and the real-launch fixture completed.Known boundary: GLib's desktop loader checks the executable name before expanding
%%, so percent-bearing executable names remain a launcher limitation. The real-launch fixture tests literal percent characters in arguments. See the Exec specification and GLib loader.A separate 0.5 quoting backport lets existing consumers receive this fix without a global 0.6 upgrade. A small 0.5 filesystem backport separately restores the recursive-directory/complete-write fix from #19 with contributor credit. Both maintenance candidates passed their separate native Linux tests on disposable secretless Crabboxes, with independent source and proof review: the 0.5 quoting candidate passed the real GIO executable/argument fixture; the filesystem candidate passed the fresh-HOME, replacement, disable and filesystem-error fixture. They still require an upstream maintenance release; no version is invented or published.