From 7381b62af962acfb646afe8b01101a290120cf75 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 16:05:20 +0200 Subject: [PATCH] fix: fill takes values literally; the notifier path is quoted in its unit --- CHANGELOG.md | 3 ++- lib/common.sh | 11 +++++++---- services/steamify-update-check.service | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60efe05..1e51766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ one per merged pull request. ## 2.5.0 - 2026-09-27 -- **refactor: DKMS confs in patches/; an existing leds-valve DKMS override is kept and restored** +- **fix: fill takes values literally; the notifier path is quoted in its unit** +- `cce31e1` **refactor: DKMS confs in patches/; an existing leds-valve DKMS override is kept and restored** - `bd4fa3a` **refactor: The session sync and kernel headers scripts in patches/** - `8ffa0f2` **refactor: systemd units in services/, read with service_file like patches/** - `8a2601d` **docs: README screenshot at 2.5.0 with Update notifications; AGENTS.md: retake it when rows change** diff --git a/lib/common.sh b/lib/common.sh index e709249..478e5e1 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -13,12 +13,15 @@ patch_file() { cat "$SCRIPT_DIR/patches/$1"; } # in. The single-file build replaces service_raw like patch_file. service_raw() { cat "$SCRIPT_DIR/services/$1"; } service_file() { local name="$1"; shift; service_raw "$name" | fill "$@"; } -# fill [KEY=value...]: stdin with each @KEY@ replaced by its value (paths, -# names; no "|" in them). +# fill [KEY=value...]: stdin with each @KEY@ replaced by its value, taken +# literally (a home folder may contain sed's "&", "\" or "|"). fill() { - local kv + local kv v local -a subst=(-e '') - for kv in "$@"; do subst+=(-e "s|@${kv%%=*}@|${kv#*=}|g"); done + for kv in "$@"; do + v="${kv#*=}"; v="${v//\\/\\\\}"; v="${v//&/\\&}"; v="${v//|/\\|}" + subst+=(-e "s|@${kv%%=*}@|$v|g") + done sed "${subst[@]}" } warn() { echo -e "${c_yellow}[WARN]${c_reset} $*"; } diff --git a/services/steamify-update-check.service b/services/steamify-update-check.service index 8265476..7bcf153 100644 --- a/services/steamify-update-check.service +++ b/services/steamify-update-check.service @@ -8,7 +8,8 @@ PartOf=graphical-session.target Type=simple # The short wait at login lets the tray come up first (in the script: an # ExecStartPre sleep runs into the start timeout). -ExecStart=@NOTIFY_SCRIPT@ --delay 60 +# Quoted: the path is in the home folder, which may contain a space. +ExecStart="@NOTIFY_SCRIPT@" --delay 60 [Install] WantedBy=plasma-workspace.target