Skip to content

Commit 669b7b2

Browse files
AI3Iclaude
andcommitted
Release v2.0.8: temp file, sed injection, and strict mode fixes
- Move weatheralert/kerchunkd/statekeeper temp files out of /tmp (fs.protected_regular class, same root cause as 2.0.7 batch) - Fix statekeeper.sh sed injection via CT config values with / (escape_sed_replacement now in common.sh for all scripts) - Fix set -euo pipefail order (after source) in 5 scripts - Fix msgwriter.sh xargs splitting on whitespace (-d '\n') - Bump version to 2.0.8 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 092cb7f commit 669b7b2

26 files changed

Lines changed: 104 additions & 78 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to `app_rpt__ultra` are documented here.
44

55
---
66

7+
## [2.0.8] - 2026-04-02
8+
9+
### Fixed
10+
- **`weatheralert.sh`: Alert audio temp file vulnerable to `fs.protected_regular`**`/tmp/weather_alert_message.ulaw` failed silently after first run (same root cause as 2.0.7 `weatherkeeper.sh` fix). Moved to stable per-node path `${BASEDIR}/lib/weatheralert_${MYNODE}.ulaw`.
11+
- **`kerchunkd.sh`: PID/lock/state files in `/tmp` vulnerable to `fs.protected_regular`**`/tmp/kerchunkd.pid`, `/tmp/kerchunkd.lock`, and `/tmp/app_rpt_kerchunk/` moved to `${BASEDIR}/lib/` per-node paths.
12+
- **`statekeeper.sh`: State file in `/tmp` vulnerable to `fs.protected_regular`**`/tmp/app_rpt_last_state` moved to `${BASEDIR}/lib/last_state_${MYNODE}`.
13+
- **`statekeeper.sh`: sed injection via courtesy tone config values** — CT config values (e.g. `ct/unlinked`) containing `/` corrupted `rpt.conf` sed expressions. All CT variable substitutions now wrapped with `escape_sed_replacement()`.
14+
- **`statekeeper.sh`: `set -euo pipefail` after `source common.sh`** — Moved before `source` so errors during `common.sh` loading are caught (same fix applied to `configkeeper.sh` in 2.0.7).
15+
- **`weatheralert.sh`, `asterisk.sh`, `cmdparser.sh`, `ctkeeper.sh`, `ctwriter.sh`: `set -euo pipefail` after `source common.sh`** — Moved before `source` in all five scripts.
16+
- **`msgwriter.sh`: `xargs cat` splits on whitespace** — Changed to `xargs -d '\n' cat` so sound file paths containing spaces are handled correctly.
17+
18+
### Infrastructure
19+
- `escape_sed_replacement()` moved to `common.sh` so all scripts can use it (previously only available in `upgrade.sh`).
20+
21+
---
22+
723
## [2.0.7] - 2026-04-01
824

925
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.7
1+
2.0.8

app_rpt/bin/asterisk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
source "%%BASEDIR%%/bin/common.sh"
2221
set -euo pipefail
22+
source "%%BASEDIR%%/bin/common.sh"
2323

2424
case "$1" in
2525
restart) # Restart Asterisk
@@ -49,4 +49,4 @@ stop) # Stop Asterisk
4949
;;
5050
esac
5151

52-
###VERSION=2.0.7
52+
###VERSION=2.0.8

app_rpt/bin/cmdparser.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
source "%%BASEDIR%%/bin/common.sh"
2221
set -euo pipefail
22+
source "%%BASEDIR%%/bin/common.sh"
2323

2424
# USAGE: Accept single digit commands from CLI or DTMF with
2525
# prepended 0 or otherwise proceed with double digits as entered
@@ -57,4 +57,4 @@ status) # Status Commands
5757
;;
5858
esac
5959

60-
###VERSION=2.0.7
60+
###VERSION=2.0.8

app_rpt/bin/common.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ die() {
119119
exit 1
120120
}
121121

122+
# Escape a string for safe use as a sed replacement value.
123+
# Escapes \, /, and & which have special meaning in sed replacement strings.
124+
# Usage: escaped=$(escape_sed_replacement "value")
125+
escape_sed_replacement() {
126+
printf '%s' "$1" | sed 's/[\\&/]/\\&/g'
127+
}
128+
122129
# ==============================================================================
123130
# Validation Functions
124131
# ==============================================================================
@@ -166,4 +173,4 @@ ast_play() {
166173
ast_cmd "rpt localplay $MYNODE $1"
167174
}
168175

169-
###VERSION=2.0.7
176+
###VERSION=2.0.8

app_rpt/bin/configkeeper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ sudo asterisk -rx "module reload"
8181
# Reload configuration changes for allmon3
8282
sudo systemctl reload allmon3
8383

84-
###VERSION=2.0.7
84+
###VERSION=2.0.8

app_rpt/bin/ctkeeper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
source "%%BASEDIR%%/bin/common.sh"
2221
set -euo pipefail
22+
source "%%BASEDIR%%/bin/common.sh"
2323

2424
# PURPOSE: Allow changing courtesy tones from table of courtesy tones
2525
# defined in rpt.conf (template: 00-99) and announce change locally.
@@ -49,4 +49,4 @@ unlinkedct)
4949
;;
5050
esac
5151

52-
###VERSION=2.0.7
52+
###VERSION=2.0.8

app_rpt/bin/ctwriter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
source "%%BASEDIR%%/bin/common.sh"
2221
set -euo pipefail
22+
source "%%BASEDIR%%/bin/common.sh"
2323

2424
# PURPOSE: Ability to generate courtesy tones from CLI or DTMF dynamically without having to directly edit file.
2525
#
@@ -90,4 +90,4 @@ else
9090
exit 1
9191
fi
9292

93-
###VERSION=2.0.7
93+
###VERSION=2.0.8

app_rpt/bin/datadumper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ else
5656
exit 1
5757
fi
5858

59-
###VERSION=2.0.7
59+
###VERSION=2.0.8

app_rpt/bin/datekeeper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ if ! cat "${SNDMALE}/today.ulaw" \
4040
exit 1
4141
fi
4242

43-
###VERSION=2.0.7
43+
###VERSION=2.0.8

0 commit comments

Comments
 (0)