From 07150f291d265f22b592214296e770382208b225 Mon Sep 17 00:00:00 2001 From: Green Baneling Date: Mon, 5 Oct 2026 00:17:41 +0100 Subject: [PATCH] fix(ens): make setup-ens-resolver.sh run on bash 3.2 `${var,,}` is a bash 4 expansion. macOS ships /bin/bash 3.2, which parses it and then stops with "bad substitution" at the owner check, so the script cannot run there, dry run included. Both comparisons now lowercase through `tr` under LC_ALL=C. macOS `tr` follows the locale: unpinned, `A-Z` mis-maps hex digits in 111 of the 288 locales on macOS 26.3 and `[:upper:]` in 2, and equal addresses in different case are refused. Assisted-by: Claude Fable 5.1 Signed-off-by: Green Baneling --- scripts/setup-ens-resolver.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/setup-ens-resolver.sh b/scripts/setup-ens-resolver.sh index 8653a266..4b7df5ff 100755 --- a/scripts/setup-ens-resolver.sh +++ b/scripts/setup-ens-resolver.sh @@ -54,7 +54,8 @@ echo "signer $signer (from $AWS_KMS_KEY_ID)" # revert after a deploy leaves a contract nobody points at. owner=$(cast call "$REGISTRY" "owner(bytes32)(address)" "$node" --rpc-url "$RPC_URL") echo "owner $owner" -if [ "${owner,,}" != "${signer,,}" ]; then +if [ "$(echo "$owner" | LC_ALL=C tr '[:upper:]' '[:lower:]')" != \ + "$(echo "$signer" | LC_ALL=C tr '[:upper:]' '[:lower:]')" ]; then echo "refusing: the KMS key is not the owner of $ENS_NAME" >&2 exit 1 fi @@ -103,7 +104,8 @@ cast send --aws --rpc-url "$RPC_URL" "$REGISTRY" \ # that still points at whatever it did before. now=$(cast call "$REGISTRY" "resolver(bytes32)(address)" "$node" --rpc-url "$RPC_URL") echo "set $now" -if [ "${now,,}" != "${resolver,,}" ]; then +if [ "$(echo "$now" | LC_ALL=C tr '[:upper:]' '[:lower:]')" != \ + "$(echo "$resolver" | LC_ALL=C tr '[:upper:]' '[:lower:]')" ]; then echo "refusing: the registry still names $now — setResolver did not take" >&2 exit 1 fi