Add '--' to prevent 'send' from interpreting passwords beginning with '-' as options.

See #624.
This commit is contained in:
Giraffe1966 2018-10-11 17:58:29 -04:00
parent 290d0d08f2
commit f2f248e6ce
No known key found for this signature in database
GPG key ID: D808FC34E342013A

View file

@ -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