Remove --exec entirely; --exec-arg is the only click-command form

A free-form shell-string --exec sitting next to the safe --exec-arg is a
standing invitation for the next caller to interpolate untrusted data and
reintroduce the RCE. Remove it: omarchy-notification-send --exec now errors and
points at --exec-arg, and the shell drops the omarchy-exec string hint and its
bash -lc execution path, leaving only the argv path.

Migrate the remaining string callers (the first-run invitation hooks, wifi and
welcome prompts) to --exec-arg, and update their notification mocks. Trim the
verbose security comments added along the way.
This commit is contained in:
Ryan Hughes
2026-08-23 13:35:02 -04:00
parent d2fd2e11c6
commit eb988b42e6
17 changed files with 97 additions and 158 deletions
+5 -9
View File
@@ -54,15 +54,11 @@ QtObject {
Quickshell.execDetached(["bash", "-lc", command])
}
// Run an argv vector safely: the script text is the constant `exec "$@"`, so
// the arguments only ever land in bash's positional parameters, which it
// expands without re-tokenizing or re-evaluating — a value carrying
// attacker-controlled data ($(id), a filename, a title) stays one literal
// argument and can never turn into a command. The login shell (-l) is what
// makes this a drop-in for execDetached: click actions launch GUI apps
// (tensaku, mpv, xdg-open) that need the same PATH and session environment the
// login shell set up. Prefer this over execDetached for any command assembled
// from untrusted input.
// Run an argv vector without a shell interpreting it: the constant `exec "$@"`
// means the args only ever land in positional parameters, which bash expands
// without re-tokenizing — so untrusted data ($(id), a filename) stays literal.
// The login shell (-l) keeps the PATH/session env GUI targets (tensaku, mpv,
// xdg-open) need. Prefer this over execDetached for anything built from input.
function execArgv(argv) {
Quickshell.execDetached(["bash", "-lc", 'exec "$@"', "bash"].concat(argv))
}