aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2022-11-01 20:06:40 +0100
committerThomas Lange <code@nerdmind.de>2022-11-01 20:29:07 +0100
commit946a445d24a0f9b9e8519968bc47dcd15df09f11 (patch)
tree670ffdb844a8fb7406ac5ab14aaa87a73601591e
parent077d8cbceb893e83a5425f73a9236b146f0de983 (diff)
downloadpainlessle-946a445d24a0f9b9e8519968bc47dcd15df09f11.tar.gz
painlessle-946a445d24a0f9b9e8519968bc47dcd15df09f11.tar.xz
painlessle-946a445d24a0f9b9e8519968bc47dcd15df09f11.zip
Process arguments containing white space correctly
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.
-rwxr-xr-xpackage/sbin/painless-le2
1 files changed, 1 insertions, 1 deletions
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