From c4d8a1d815e79ddd89a85d3e36a41d29f0475771 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sun, 6 Mar 2022 23:06:56 +0100 Subject: emacs: Fix an infloop on Windows enviroments The infloop has been observed in calls to `pasword-store--run' for pass v1.7.4 in a Windows/WSL2 enviroment. When this happens, the sentinel in `password-store--run-1' doesn't call the callback. * contrib/emacs/password-store.el (password-store--run-1): Prefer `process-status' over the string comparison to check the process status. Problem reported by Kai Tetzlaff : https://lists.zx2c4.com/pipermail/password-store/2022-February/004583.html --- contrib/emacs/CHANGELOG.md | 4 ++++ contrib/emacs/password-store.el | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md index 7173f65..ed85577 100644 --- a/contrib/emacs/CHANGELOG.md +++ b/contrib/emacs/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.5 + +* (bugfix) Fix an infloop on Windows enviroments. + # 2.1.4 * Drop dependency on f library. diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index 61c339e..1d23090 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -88,9 +88,10 @@ or outputs error message on failure." (setq output (concat output text))) :sentinel (lambda (process state) (cond - ((string= state "finished\n") + ((and (eq (process-status process) 'exit) + (zerop (process-exit-status process))) (funcall callback output)) - ((string= state "open\n") (accept-process-output process)) + ((eq (process-status process) 'run) (accept-process-output process)) (t (error (concat "password-store: " state)))))))) (defun password-store--run (&rest args) -- cgit v1.2.3