From f2f248e6ceb0252a01455ecc8109731cabb84e0f Mon Sep 17 00:00:00 2001 From: Giraffe1966 <35208168+Giraffe1966@users.noreply.github.com> Date: Thu, 11 Oct 2018 17:58:29 -0400 Subject: [PATCH] Add '--' to prevent 'send' from interpreting passwords beginning with '-' as options. See #624. --- scripts/makeOVPN.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index e4d8962..c37225d 100755 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -116,8 +116,8 @@ function keyPASS() { expect << EOF set timeout -1 spawn ./easyrsa build-client-full "${NAME}" - expect "Enter PEM pass phrase" { send "${PASSWD}\r" } - expect "Verifying - Enter PEM pass phrase" { send "${PASSWD}\r" } + expect "Enter PEM pass phrase" { send -- "${PASSWD}\r" } + expect "Verifying - Enter PEM pass phrase" { send -- "${PASSWD}\r" } expect eof EOF @@ -126,9 +126,9 @@ EOF expect << EOF set timeout -1 spawn openssl rsa -in ${KEY_FILE} -aes128 -out ${KEY_FILE} - expect "Enter pass phrase" { send "${PASSWD}\r" } - expect "Enter PEM pass phrase" { send "${PASSWD}\r" } - expect "Verifying - Enter PEM pass phrase" { send "${PASSWD}\r" } + expect "Enter pass phrase" { send -- "${PASSWD}\r" } + expect "Enter PEM pass phrase" { send -- "${PASSWD}\r" } + expect "Verifying - Enter PEM pass phrase" { send -- "${PASSWD}\r" } expect eof EOF