mirror of
https://github.com/dtzp555-max/olp.git
synced 2026-07-19 09:45:07 +00:00
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 <dtzp555@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -544,7 +544,7 @@ except: print('')" 2>/dev/null || echo "")
|
|||||||
# D74 P1-2: validate server-advertised token shape before consuming.
|
# D74 P1-2: validate server-advertised token shape before consuming.
|
||||||
# A hostile or misconfigured server could otherwise inject arbitrary
|
# A hostile or misconfigured server could otherwise inject arbitrary
|
||||||
# strings into the user's rc file via the `anonymousKey` field.
|
# 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."
|
log_err "Refusing to consume malformed advertised key. Use --key explicitly or contact the OLP operator."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user