Fix bug in get-or-generate.

This commit is contained in:
Manuel Amador (Rudd-O) 2017-05-14 15:19:34 +00:00
parent d7fcf965a2
commit e2280ad7b8
3 changed files with 21 additions and 28 deletions

View File

@ -28,11 +28,9 @@ $key" | /usr/lib/qubes/qrexec-client-vm "$QUBES_PASS_DOMAIN" ruddo.PassRead
elif [ "$1" == "get-or-generate" ] ; then elif [ "$1" == "get-or-generate" ] ; then
cmd=$(echo "$1" | base64 -w 0) cmd=$(echo "$1" | base64 -w 0)
key=$(echo "$2" | base64 -w 0) key=$(echo "$2" | base64 -w 0)
autogen=$(echo 1 | base64 -w 0)
nosymbols=$(echo "$3" | base64 -w 0) nosymbols=$(echo "$3" | base64 -w 0)
echo "$cmd echo "$cmd
$key $key
$autogen
$nosymbols" | /usr/lib/qubes/qrexec-client-vm "$QUBES_PASS_DOMAIN" ruddo.PassManage $nosymbols" | /usr/lib/qubes/qrexec-client-vm "$QUBES_PASS_DOMAIN" ruddo.PassManage
elif [ "$1" == "rm" ] ; then elif [ "$1" == "rm" ] ; then

View File

@ -37,12 +37,10 @@ EOF
elif [ "$cmd" == "get-or-generate" ] ; then elif [ "$cmd" == "get-or-generate" ] ; then
read -n 4096 entry read -n 4096 entry
read -n 4096 autogen
read -n 4096 nosymbols read -n 4096 nosymbols
entry=$(echo "$entry" | base64 -d) entry=$(echo "$entry" | base64 -d)
nosymbols=$(echo "nosymbols" | base64 -d) nosymbols=$(echo "$nosymbols" | base64 -d)
if [ "$autogen" == "1" ] ; then
ret=0 ; out=$(pass -- "$entry" 2>&1) || ret=$? ret=0 ; out=$(pass -- "$entry" 2>&1) || ret=$?
if [ "$ret" == "1" ] && echo "$out" | grep -q "not in the password store" ; then if [ "$ret" == "1" ] && echo "$out" | grep -q "not in the password store" ; then
logger -t ruddo.PassManage "creating password entry $entry" logger -t ruddo.PassManage "creating password entry $entry"
@ -62,9 +60,6 @@ elif [ "$cmd" == "get-or-generate" ] ; then
fi fi
logger -t ruddo.PassManage "requested password entry $entry" logger -t ruddo.PassManage "requested password entry $entry"
exec pass -- "$entry" exec pass -- "$entry"
else
exit 23
fi
elif [ "$cmd" == "insert" ] ; then elif [ "$cmd" == "insert" ] ; then

View File

@ -3,7 +3,7 @@
%define mybuildnumber %{?build_number}%{?!build_number:1} %define mybuildnumber %{?build_number}%{?!build_number:1}
Name: qubes-pass Name: qubes-pass
Version: 0.0.8 Version: 0.0.9
Release: %{mybuildnumber}%{?dist} Release: %{mybuildnumber}%{?dist}
Summary: Inter-VM pass password management for Qubes OS AppVMs and StandaloneVMs Summary: Inter-VM pass password management for Qubes OS AppVMs and StandaloneVMs
BuildArch: noarch BuildArch: noarch