Replace --exec-arg with an ergonomic --exec that consumes the rest of the line as the click command. The caller's shell tokenizes the words into discrete arguments before the tool sees them, and the shell runs them as positional parameters (never a re-parsed string), so safety is identical to the argv form while the call sites read naturally: `--exec omarchy toggle something`. Crucially the tool never splits a string itself — a single quoted whole-command argument is rejected and points at the unquoted form, because whitespace- splitting a string hands argument boundaries to whoever controls its content (the injection we are avoiding). --exec must come last; migrate every caller.
13 lines
527 B
Bash
13 lines
527 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Only invite when there's a reader to use and it isn't set up yet (the lock
|
|
# PAM file is the last thing the setup writes on success).
|
|
if omarchy-hw-fingerprint && [[ ! -f /etc/pam.d/omarchy-lock-fingerprint ]] &&
|
|
omarchy-done ensure fingerprint-setup-invitation; then
|
|
omarchy-notification-send -u critical -g "Setup Fingerprint Reader" \
|
|
"Enable sudo and unlocking with your fingerprint." \
|
|
--exec omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fingerprint
|
|
fi
|