[critical] new call syntax regression breaks hook.sh deploy_challenge and probably clean_challenge #554

Closed
opened 2025-12-29 01:27:10 +01:00 by adam · 2 comments
Owner

Originally created by @struanb on GitHub (Nov 2, 2021).

I'm experiencing a regression in master branch, probably caused by commit e963438c5a5d58ce3f997eef1e8e25f3cb4238d8 (make shellcheck happy again), specifically the following lines:

@@ -1083,12 +1096,12 @@ sign_csr() {
   if [[ ${num_pending_challenges} -ne 0 ]]; then
     echo " + Deploying challenge tokens..."
     if [[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]]; then
-      "${HOOK}" "deploy_challenge" ${deploy_args[@]} || _exiterr 'deploy_challenge hook returned with non-zero exit code'
+      "${HOOK}" "deploy_challenge" "${deploy_args[@]}" || _exiterr 'deploy_challenge hook returned with non-zero exit code'
     elif [[ -n "${HOOK}" ]]; then
       # Run hook script to deploy the challenge token
       local idx=0
       while [ ${idx} -lt ${num_pending_challenges} ]; do
-        "${HOOK}" "deploy_challenge" ${deploy_args[${idx}]} || _exiterr 'deploy_challenge hook returned with non-zero exit code'
+        "${HOOK}" "deploy_challenge" "${deploy_args[${idx}]}" || _exiterr 'deploy_challenge hook returned with non-zero exit code'
         idx=$((idx+1))
       done
     fi

The result of the change appears to be that instead of the hook.sh deploy_challenge being passed three arguments (the expanded ${deploy_args[${idx}]}), it is now passed one argument ("${deploy_args[${idx}]}", which expands to a string consisting of the three arguments joined by spaces).

I suspect the modified call to the hook for clean_challenge is also broken in the same way.

To reproduce the issue, just run dehydrated with a stock hook.

Originally created by @struanb on GitHub (Nov 2, 2021). I'm experiencing a regression in master branch, probably caused by commit `e963438c5a5d58ce3f997eef1e8e25f3cb4238d8` (make shellcheck happy again), specifically the following lines: ``` @@ -1083,12 +1096,12 @@ sign_csr() { if [[ ${num_pending_challenges} -ne 0 ]]; then echo " + Deploying challenge tokens..." if [[ -n "${HOOK}" ]] && [[ "${HOOK_CHAIN}" = "yes" ]]; then - "${HOOK}" "deploy_challenge" ${deploy_args[@]} || _exiterr 'deploy_challenge hook returned with non-zero exit code' + "${HOOK}" "deploy_challenge" "${deploy_args[@]}" || _exiterr 'deploy_challenge hook returned with non-zero exit code' elif [[ -n "${HOOK}" ]]; then # Run hook script to deploy the challenge token local idx=0 while [ ${idx} -lt ${num_pending_challenges} ]; do - "${HOOK}" "deploy_challenge" ${deploy_args[${idx}]} || _exiterr 'deploy_challenge hook returned with non-zero exit code' + "${HOOK}" "deploy_challenge" "${deploy_args[${idx}]}" || _exiterr 'deploy_challenge hook returned with non-zero exit code' idx=$((idx+1)) done fi ``` The result of the change appears to be that instead of the hook.sh `deploy_challenge` being passed three arguments (the expanded `${deploy_args[${idx}]}`), it is now passed _one argument_ (`"${deploy_args[${idx}]}"`, which expands to a string consisting of the three arguments joined by spaces). I suspect the modified call to the hook for `clean_challenge` is also broken in the same way. To reproduce the issue, just run dehydrated with a stock hook.
adam closed this issue 2025-12-29 01:27:10 +01:00
Author
Owner

@lukas2511 commented on GitHub (Nov 2, 2021):

Mh... interesting...

@lukas2511 commented on GitHub (Nov 2, 2021): Mh... interesting...
Author
Owner

@lukas2511 commented on GitHub (Nov 2, 2021):

Ah... i see what my mistake was... sorry for that... Should be fully reverted now.

@lukas2511 commented on GitHub (Nov 2, 2021): Ah... i see what my mistake was... sorry for that... Should be fully reverted now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#554