mirror of
https://github.com/gaschz/qubes-pass.git
synced 2025-06-07 01:38:31 +02:00
Fix handling of NUL data in inter-VM operations.
This commit is contained in:
parent
f603dda2f2
commit
a92c4ca1fb
@ -54,7 +54,7 @@ elif [ "$1" == "insert" ] ; 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)
|
||||||
multiline=$(echo "$3" | base64 -w 0)
|
multiline=$(echo "$3" | base64 -w 0)
|
||||||
contents=$(echo "$4" | base64 -w 0)
|
contents=$(echo "$4") # Insert already sends its first parameters base64-encoded
|
||||||
echo "$cmd
|
echo "$cmd
|
||||||
$key
|
$key
|
||||||
$multiline
|
$multiline
|
||||||
|
@ -135,7 +135,7 @@ case "$1" in
|
|||||||
if [ "$multiline" == "1" ] ; then
|
if [ "$multiline" == "1" ] ; then
|
||||||
echo "Enter contents of $1 and press Ctrl+D when finished:"
|
echo "Enter contents of $1 and press Ctrl+D when finished:"
|
||||||
echo ""
|
echo ""
|
||||||
contents=$(cat)
|
contents=$(cat | base64 -w 0)
|
||||||
elif [ "$echo" == "1" ] ; then
|
elif [ "$echo" == "1" ] ; then
|
||||||
read -p "Enter password for $1: " contents >&2
|
read -p "Enter password for $1: " contents >&2
|
||||||
else
|
else
|
||||||
|
@ -68,14 +68,14 @@ elif [ "$cmd" == "insert" ] ; then
|
|||||||
read -n 1048576 contents
|
read -n 1048576 contents
|
||||||
entry=$(echo "$entry" | base64 -d)
|
entry=$(echo "$entry" | base64 -d)
|
||||||
multiline=$(echo "$multiline" | base64 -d)
|
multiline=$(echo "$multiline" | base64 -d)
|
||||||
contents=$(echo "$contents" | base64 -d)
|
contents=$(echo "$contents")
|
||||||
|
|
||||||
logger -t ruddo.PassManage "creating password entry $entry"
|
logger -t ruddo.PassManage "creating password entry $entry"
|
||||||
|
|
||||||
if [ "$multiline" == "1" ] ; then
|
if [ "$multiline" == "1" ] ; then
|
||||||
echo "$contents" | pass insert --multiline --force -- "$entry"
|
echo "$contents" | base64 -d | pass insert --multiline --force -- "$entry"
|
||||||
else
|
else
|
||||||
echo "$contents" | pass insert -e --force -- "$entry"
|
echo "$contents" | base64 -d | pass insert -e --force -- "$entry"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$cmd" == "rm" ] ; then
|
elif [ "$cmd" == "rm" ] ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user