Fix release CI: stale bread-theme tag path + calamares default-branch clone

- release-iso.yml's "Build bread-theme from source" step grepped
  bos-settings/Cargo.toml for the bread-theme tag pin, but bos-settings was
  split out into its own repo (git.breadway.dev/Breadway/bos-settings) --
  that path no longer exists in this checkout, so the grep would fail (or
  silently find nothing). Now fetches bos-settings' Cargo.toml directly from
  its own repo (dev branch, the one its own CI actually publishes the
  bos-settings pacman package from) via the Forgejo raw-file endpoint.

- calamares.yml cloned the repo's default branch instead of the branch/tag
  that actually triggered the run -- bibata.yml, powerlevel10k.yml, and
  yay-bin.yml (the other in-house-PKGBUILD workflows in this same family)
  all correctly clone --branch "${GITHUB_REF_NAME}". Brought calamares.yml
  in line with them.

- breadhelp-tour.lua interpolated an untrusted, client-controlled Wayland
  window class / layer-shell namespace directly into a bread.exec shell
  command string -- a session-level shell injection vector (verified
  exploitable with a crafted window class before this fix, e.g.
  "evil; touch ~/pwned #"). bread.exec only accepts a single shell string
  (always run via `sh -lc`, per breadd/src/lua/mod.rs) -- there's no
  array-exec form to bypass the shell with -- so the fix is a proper POSIX
  shell_quote() helper wrapping every interpolated value in single quotes
  before it reaches bread.exec.
This commit is contained in:
Breadway 2026-07-17 03:28:48 +08:00
parent c67cc3c6f6
commit cd5bf1b546
3 changed files with 35 additions and 6 deletions

View file

@ -18,9 +18,23 @@
local M = bread.module({ name = "breadhelp-tour", version = "1.0.0" })
-- `bread.exec` only takes a single shell command string — it always runs it
-- as `sh -lc <cmd>` (see breadd's Lua runtime), there's no array-exec form
-- that bypasses the shell. `event.data.class` (a Wayland window class) and
-- `event.data.data` (a layer-shell namespace) are both arbitrary strings a
-- client fully controls — a window/surface can name itself
-- `x; rm -rf ~ #` and have that land in a real shell command otherwise.
-- POSIX single-quoting neutralizes that: wrap the value in single quotes,
-- and turn any single quote *inside* it into `'\''` (close the quote, an
-- escaped literal quote, reopen the quote) — the one escaping rule `sh`
-- needs to treat the whole thing as inert data, never command syntax.
local function shell_quote(s)
return "'" .. tostring(s):gsub("'", "'\\''") .. "'"
end
function M.on_load()
bread.on("bread.window.opened", function(event)
bread.exec("breadhelp --tour-event window:" .. event.data.class)
bread.exec("breadhelp --tour-event " .. shell_quote("window:" .. event.data.class))
end)
bread.on("bread.workspace.changed", function(event)
@ -28,11 +42,11 @@ function M.on_load()
end)
bread.hyprland.on_raw("openlayer", function(event)
bread.exec("breadhelp --tour-event layer:" .. event.data.data)
bread.exec("breadhelp --tour-event " .. shell_quote("layer:" .. event.data.data))
end)
bread.hyprland.on_raw("closelayer", function(event)
bread.exec("breadhelp --tour-event layer-closed:" .. event.data.data)
bread.exec("breadhelp --tour-event " .. shell_quote("layer-closed:" .. event.data.data))
end)
end