commit c9dc5538a8158b10a226eeb44d865e57d3d81c88
parent ec27ece8fcc0bde0571cafe2ed28b15614536d27
Author: Svend Sorensen <svend@ciffer.net>
Date: Thu, 8 Jan 2015 13:36:45 -0800
emacs: Quote shell arguments
Quote shell arguments for insert so that it handles passwords and entry
names that contain special characters.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
@@ -200,7 +200,10 @@ Separate multiple IDs with spaces."
"Insert a new ENTRY containing PASSWORD."
(interactive (list (read-string "Password entry: ")
(read-passwd "Password: " t)))
- (message (shell-command-to-string (format "echo %s | %s insert -m -f %s" password password-store-executable entry))))
+ (message (shell-command-to-string (format "echo %s | %s insert -m -f %s"
+ (shell-quote-argument password)
+ password-store-executable
+ (shell-quote-argument entry)))))
;;;###autoload
(defun password-store-generate (entry &optional password-length)