From: Frederick Morlock Date: Wed, 23 Dec 2020 16:48:52 +0000 (+0800) Subject: openconnect: Fix secondary password script overwriting primary X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5d85f5af6358ed2350ffc6641fee67db1b07d619;p=openwrt-packages.git openconnect: Fix secondary password script overwriting primary When specifying a secondary password script, the output should be appended to the temporary password file and shouldn't overwrite it. If you refer to the case where there is a static secondary password, you can see that the secondary password is appended. Without this fix, only the secondary password is passed to the `openconnect` session. Signed-off-by: Frederick Morlock --- diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index d310cf5c1..37f1945f4 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -115,7 +115,7 @@ proto_openconnect_setup() { [ -n "$password2" ] && echo "$password2" >> "$pwfile" } [ "$token_mode" = "script" ] && { - $token_script > "$pwfile" 2> /dev/null || { + $token_script >> "$pwfile" 2> /dev/null || { logger -t openconenct "Cannot get password from script '$token_script'" proto_setup_failed "$config" }