From cc250e71bfbbbe92ac6485133994881d9740f261 Mon Sep 17 00:00:00 2001 From: dtzp555-max Date: Wed, 27 May 2026 12:25:17 +1000 Subject: [PATCH] fix(olp-connect): line 547 referenced undefined \$remote_host (bash nounset crash) (#61) bin/olp-connect declares \$host and \$port locally (line 436) but line 547 referenced an undefined \$remote_host. Under set -u (nounset) the script aborted with "remote_host: unbound variable" on every successful /health probe path that surfaced an anonymousKey, blocking the zero-config client setup that D68-D70 + ADR 0011 designed. Fix: use \${host}:\${port} (the actual local variables) for the error-log context. The variable was only used as a message-context string passed into validate_olp_token, so no behavior change beyond the message. Discovered while bringing up MacBook as anonymous client of PI231 server (2026-05-27). Reproduced cleanly on the v0.5.1 main branch. Co-authored-by: dtzp555 Co-authored-by: Claude Opus 4.7 --- bin/olp-connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/olp-connect b/bin/olp-connect index 33ad62c..0ae208c 100755 --- a/bin/olp-connect +++ b/bin/olp-connect @@ -544,7 +544,7 @@ except: print('')" 2>/dev/null || echo "") # D74 P1-2: validate server-advertised token shape before consuming. # A hostile or misconfigured server could otherwise inject arbitrary # strings into the user's rc file via the `anonymousKey` field. - if ! validate_olp_token "$anon_key" "/health.anonymousKey from $remote_host"; then + if ! validate_olp_token "$anon_key" "/health.anonymousKey from ${host}:${port}"; then log_err "Refusing to consume malformed advertised key. Use --key explicitly or contact the OLP operator." exit 2 fi