mirror of
				https://github.com/gaschz/qubes-pass.git
				synced 2025-11-04 05:28:53 +01: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)
 | 
			
		||||
    key=$(echo "$2" | 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
 | 
			
		||||
$key
 | 
			
		||||
$multiline
 | 
			
		||||
 | 
			
		||||
@ -135,7 +135,7 @@ case "$1" in
 | 
			
		||||
        if [ "$multiline" == "1" ] ; then
 | 
			
		||||
            echo "Enter contents of $1 and press Ctrl+D when finished:"
 | 
			
		||||
            echo ""
 | 
			
		||||
            contents=$(cat)
 | 
			
		||||
            contents=$(cat | base64 -w 0)
 | 
			
		||||
        elif [ "$echo" == "1" ] ; then
 | 
			
		||||
            read -p "Enter password for $1: " contents >&2
 | 
			
		||||
        else
 | 
			
		||||
 | 
			
		||||
@ -68,14 +68,14 @@ elif [ "$cmd" == "insert" ] ; then
 | 
			
		||||
  read -n 1048576 contents
 | 
			
		||||
  entry=$(echo "$entry" | base64 -d)
 | 
			
		||||
  multiline=$(echo "$multiline" | base64 -d)
 | 
			
		||||
  contents=$(echo "$contents" | base64 -d)
 | 
			
		||||
  contents=$(echo "$contents")
 | 
			
		||||
 | 
			
		||||
  logger -t ruddo.PassManage "creating password entry $entry"
 | 
			
		||||
 | 
			
		||||
  if [ "$multiline" == "1" ] ; then
 | 
			
		||||
      echo "$contents" | pass insert --multiline --force -- "$entry"
 | 
			
		||||
      echo "$contents" | base64 -d | pass insert --multiline --force -- "$entry"
 | 
			
		||||
  else
 | 
			
		||||
      echo "$contents" | pass insert -e --force -- "$entry"
 | 
			
		||||
      echo "$contents" | base64 -d | pass insert -e --force -- "$entry"
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
elif [ "$cmd" == "rm" ] ; then
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user