From d0b8d4bb328d33d245a10d546bec5ef3e3c05c9d Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 15 Jan 2015 22:19:28 +0000 Subject: [PATCH] lisp/gnus/nntp.el (nntp-send-authinfo): Error out if the password is wrong --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/nntp.el | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 20de9aea136..5a61a211661 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2015-01-15 Lars Magne Ingebrigtsen + + * nntp.el (nntp-send-authinfo): Error out if the password is wrong. + 2015-01-08 Stefan Monnier * registry.el: Don't use as a variable. diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index e071368401b..0891dba0387 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1219,14 +1219,17 @@ If SEND-IF-FORCE, only send authinfo to the server if the nntp-authinfo-user user)) (unless (member user '(nil "")) (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user) - (when t ;???Should check if AUTHINFO succeeded - (nntp-send-command - "^2.*\r?\n" "AUTHINFO PASS" - (or passwd - nntp-authinfo-password - (setq nntp-authinfo-password - (read-passwd (format "NNTP (%s@%s) password: " - user nntp-address)))))))))) + (let ((result + (nntp-send-command + "^2.*\r?\n" "AUTHINFO PASS" + (or passwd + nntp-authinfo-password + (setq nntp-authinfo-password + (read-passwd (format "NNTP (%s@%s) password: " + user nntp-address))))))) + (if (not result) + (signal 'nntp-authinfo-rejected "Password rejected") + result)))))) ;;; Internal functions. -- 2.39.2