* nntp.el (nntp-send-authinfo): Error out if the password is wrong.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 15 Jan 2015 21:49:15 +0000 (22:49 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 15 Jan 2015 21:49:15 +0000 (22:49 +0100)
lisp/ChangeLog
lisp/nntp.el

index 0c9d9ce..233f2de 100644 (file)
@@ -1,3 +1,7 @@
+2015-01-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nntp.el (nntp-send-authinfo): Error out if the password is wrong.
+
 2015-01-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * registry.el: Don't use <class> as a variable.
index e071368..0891dba 100644 (file)
@@ -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.