[PATCH] passmenu: Don't eat whitespace at beginning/end of password

Daniel Lublin daniel at lublin.se
Fri Sep 15 10:06:46 CEST 2017


If IFS (Input Field Separator) is not emptied, read will actually strip
spaces and tabs at the beginning/end end of the "line".
---
 contrib/dmenu/passmenu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
index 7a9c517..83268bc 100755
--- a/contrib/dmenu/passmenu
+++ b/contrib/dmenu/passmenu
@@ -20,6 +20,6 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
 if [[ $typeit -eq 0 ]]; then
 	pass show -c "$password" 2>/dev/null
 else
-	pass show "$password" | { read -r pass; printf %s "$pass"; } |
+	pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
 		xdotool type --clearmodifiers --file -
 fi
-- 
2.14.1



More information about the Password-Store mailing list