From 946a445d24a0f9b9e8519968bc47dcd15df09f11 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 1 Nov 2022 20:06:40 +0100 Subject: Process arguments containing white space correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a bug where an argument containing white space is processed as two different arguments even if the argument was quoted correctly. Example: $ painless-le "target dir" example.org www.example.org > $1="target", $2="dir", $3="example.org" [...] To ensure that white space within arguments will be processed correctly, we must call "set" within "eval", and because of "eval" we need quoted arguments, so remove the "-u" („unquoted“) option from getopt. --- package/sbin/painless-le | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/sbin/painless-le b/package/sbin/painless-le index 53015e3..2a0a75f 100755 --- a/package/sbin/painless-le +++ b/package/sbin/painless-le @@ -30,7 +30,7 @@ ACME_ENDPOINT="https://acme-v02.api.letsencrypt.org/directory" #=============================================================================== # Normalize command-line arguments with GNU getopt #=============================================================================== -set -- $(getopt -uo K:I:C:F: -- "$@") +eval set -- "$(getopt -o K:I:C:F: -- "$@")" #=============================================================================== # Parse command-line options with getopts -- cgit v1.2.3