From cf51ad22d1a1892d16586ea22ce39e38e4fd5b5f Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 12 Oct 2026 17:02:10 +0800 Subject: [PATCH] dns_baidu, dns_bhosted: pipe input to _lower_case, not an argument _lower_case reads stdin only. Called as _lower_case "$x", the argument was dropped and tr read the inherited stdin. On an interactive tty that never reaches EOF, so dns_baidu hung forever on every add/rm (#7319). Under cron stdin is /dev/null and the value came back empty: dns_baidu fell into the default engine order by luck, and the dns_bhosted fallback error checks could never match. Fixes #7319 --- dnsapi/dns_baidu.sh | 2 +- dnsapi/dns_bhosted.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dnsapi/dns_baidu.sh b/dnsapi/dns_baidu.sh index dfad8eeb..19641006 100644 --- a/dnsapi/dns_baidu.sh +++ b/dnsapi/dns_baidu.sh @@ -120,7 +120,7 @@ _baidu_run_with_fallback() { } _baidu_engine_order() { - _pref="$(_lower_case "$(_baidu_trim_ws "${Baidu_API_Preference:-auto}")")" + _pref="$(_baidu_trim_ws "${Baidu_API_Preference:-auto}" | _lower_case)" case "$_pref" in legacy) printf "%s" "legacy new" diff --git a/dnsapi/dns_bhosted.sh b/dnsapi/dns_bhosted.sh index 46ddd5dd..31da0099 100644 --- a/dnsapi/dns_bhosted.sh +++ b/dnsapi/dns_bhosted.sh @@ -283,7 +283,7 @@ _bhosted_response_has_error() { fi # Fallback for unexpected/non-XML responses - _resp_lc="$(_lower_case "$_resp")" + _resp_lc="$(printf "%s\n" "$_resp" | _lower_case)" if _contains "$_resp_lc" "error"; then _debug "Detected 'error' in response"