From 6244720c84cbcdff20190fb6713ce597133388db Mon Sep 17 00:00:00 2001 From: Sprite Date: Sun, 8 Feb 2026 02:50:08 +0000 Subject: [PATCH] refactor: quote sleep delay variables for safety Quote INSTANCE_STATUS_POLL_DELAY, SSH_RETRY_DELAY, and SPRITE_CONNECTIVITY_POLL_DELAY to prevent potential word splitting issues with unusual values. Co-Authored-By: Claude Sonnet 4.5 --- lambda/lib/common.sh | 4 ++-- sprite/lib/common.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lambda/lib/common.sh b/lambda/lib/common.sh index 7fa943ed..ad746f7c 100644 --- a/lambda/lib/common.sh +++ b/lambda/lib/common.sh @@ -166,7 +166,7 @@ print(d.get('error', {}).get('message', d.get('error', 'Unknown error'))) return 0 fi log_warn "Instance status: ${status} (${attempt}/${max_attempts})" - sleep ${INSTANCE_STATUS_POLL_DELAY}; attempt=$((attempt + 1)) + sleep "${INSTANCE_STATUS_POLL_DELAY}"; attempt=$((attempt + 1)) done log_error "Instance did not become active in time"; return 1 } @@ -180,7 +180,7 @@ verify_server_connectivity() { if ssh ${SSH_OPTS} -o ConnectTimeout=5 "ubuntu@${ip}" "echo ok" >/dev/null 2>&1; then log_info "SSH connection established"; return 0 fi - log_warn "Waiting for SSH... (${attempt}/${max_attempts})"; sleep ${SSH_RETRY_DELAY}; attempt=$((attempt + 1)) + log_warn "Waiting for SSH... (${attempt}/${max_attempts})"; sleep "${SSH_RETRY_DELAY}"; attempt=$((attempt + 1)) done log_error "Server failed to respond via SSH after ${max_attempts} attempts"; return 1 } diff --git a/sprite/lib/common.sh b/sprite/lib/common.sh index a62c464d..393dee67 100644 --- a/sprite/lib/common.sh +++ b/sprite/lib/common.sh @@ -70,7 +70,7 @@ verify_sprite_connectivity() { return 0 fi log_warn "Sprite not ready, retrying (${attempt}/${max_attempts})..." - sleep ${SPRITE_CONNECTIVITY_POLL_DELAY} + sleep "${SPRITE_CONNECTIVITY_POLL_DELAY}" ((attempt++)) done