From 26f8aae6068b4497ab53e03a3b7fff1229a734b8 Mon Sep 17 00:00:00 2001 From: AluminumTank Date: Wed, 14 Jul 2021 15:56:58 -0400 Subject: [PATCH] concatenate all values before passing to TYPE_CMD to avoid race conditions due to buffering --- wofi-pass | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wofi-pass b/wofi-pass index 8fb221a..f0c5659 100755 --- a/wofi-pass +++ b/wofi-pass @@ -103,11 +103,10 @@ if [[ $typeit -eq 0 ]]; then wl-copy "$(_pass_get $field)" else if [[ $field == "autotype" ]] || [[ $autotype -eq 1 ]]; then - _pass_get "username" | ${TYPE_CMD} - printf "\t" | ${TYPE_CMD} - _pass_get "password" | ${TYPE_CMD} - printf "\n" | ${TYPE_CMD} + username=$(_pass_get "username") + password=$(_pass_get "password") + printf "%b\t%b\n" $username $password | $TYPE_CMD else - _pass_get $field | ${TYPE_CMD} + _pass_get $field | $TYPE_CMD fi fi