rack update: work directory on /var/lib (/run is noexec)
Found by the first signed update on pxe-rack2: the signature verified, then the copy in /run could not be executed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3568c4866e
commit
703b8f1b7b
1 file changed
+3
-1
@@ -12,7 +12,9 @@ D=/var/lib/rollcall/update
|
||||
BIN=/usr/local/bin/rollcall
|
||||
[ -f "$D/ready" ] || exit 0
|
||||
want=$(head -c 64 "$D/ready" | tr -cd 'A-Za-z0-9._+-'); rm -f "$D/ready"
|
||||
W=$(mktemp -d /run/rollcall-update.XXXXXX) || exit 1
|
||||
# root's work directory, on a file system that allows executing (/run is noexec)
|
||||
install -d -m 0700 -o root -g root /var/lib/rollcall-update
|
||||
W=$(mktemp -d /var/lib/rollcall-update/w.XXXXXX) || exit 1
|
||||
trap 'rm -rf "$W"' EXIT
|
||||
# last-result is read by the rack (backoff); renamed in, so a link planted there is replaced, not followed
|
||||
result() { echo "$(date -Is) $*" > "$W/result" && mv -fT "$W/result" "$D/last-result"; echo "$*"; }
|
||||
|
||||
Reference in new issue
Block a user