From c9dc5538a8158b10a226eeb44d865e57d3d81c88 Mon Sep 17 00:00:00 2001 From: Svend Sorensen Date: Thu, 8 Jan 2015 13:36:45 -0800 Subject: emacs: Quote shell arguments Quote shell arguments for insert so that it handles passwords and entry names that contain special characters. --- contrib/emacs/password-store.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/emacs/password-store.el') diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index cdecad4..746f133 100644 --- 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) -- cgit v1.2.3-59-g8ed1b