]> git.eshelyaron.com Git - emacs.git/commitdiff
lisp/gnus/nntp.el (nntp-send-authinfo): Error out if the password is wrong
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 15 Jan 2015 22:19:28 +0000 (22:19 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 15 Jan 2015 22:19:28 +0000 (22:19 +0000)
lisp/gnus/ChangeLog
lisp/gnus/nntp.el

index 20de9aea136c6f69efd334da5c452ba6ad3d17b3..5a61a211661c09315d7783445f1622e7dffd675f 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 e071368401bd22c060f04854d5c61a541484ca4a..0891dba0387d41631f2ede65f1f775c47e8075b9 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.