[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] nsm 01/01: Have the NSM deny all non-validating connection
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] nsm 01/01: Have the NSM deny all non-validating connections non-interactively |
Date: |
Tue, 18 Nov 2014 18:20:36 +0000 |
branch: nsm
commit 4e2824b2ac409a01a905466c668cf22b40b165d5
Author: Lars Magne Ingebrigtsen <address@hidden>
Date: Tue Nov 18 19:20:27 2014 +0100
Have the NSM deny all non-validating connections non-interactively
* net/nsm.el (nsm-query): If running non-interactively, then say
`no' to everything.
---
lisp/ChangeLog | 3 +++
lisp/net/nsm.el | 25 ++++++++++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e02a64e..a3240a9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2014-11-18 Lars Magne Ingebrigtsen <address@hidden>
+ * net/nsm.el (nsm-query): If running non-interactively, then say
+ `no' to everything.
+
* mail/smtpmail.el (smtpmail-via-smtp): Warn unless encrypted if
we're sending a password.
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index 35f9ce2..83fa14b 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -166,17 +166,20 @@ unencrypted."
process)))
(defun nsm-query (id status what message &rest args)
- (let ((response
- (condition-case nil
- (nsm-query-user message args (nsm-format-certificate status))
- ;; Make sure we manage to close the process if the user hits
- ;; `C-g'.
- (quit 'no)
- (error 'no))))
- (if (eq response 'no)
- nil
- (nsm-save-host id status what response)
- t)))
+ ;; If there is no user to answer queries, then say `no' to everything.
+ (if noninteractive
+ nil
+ (let ((response
+ (condition-case nil
+ (nsm-query-user message args (nsm-format-certificate status))
+ ;; Make sure we manage to close the process if the user hits
+ ;; `C-g'.
+ (quit 'no)
+ (error 'no))))
+ (if (eq response 'no)
+ nil
+ (nsm-save-host id status what response)
+ t))))
(defun nsm-query-user (message args cert)
(let ((buffer (get-buffer-create "*Network Security Manager*")))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] nsm 01/01: Have the NSM deny all non-validating connections non-interactively,
Lars Ingebrigtsen <=