From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/77958 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: nntp.el authinfo calls need fixin' Date: Fri, 18 Mar 2011 05:22:08 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87aagswwxb.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1300443766 8838 80.91.229.12 (18 Mar 2011 10:22:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2011 10:22:46 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M26272@lists.math.uh.edu Fri Mar 18 11:22:42 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0WpN-0001vy-Os for ding-account@gmane.org; Fri, 18 Mar 2011 11:22:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Q0WpB-000095-7D; Fri, 18 Mar 2011 05:22:29 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Q0Wp8-00008k-PF for ding@lists.math.uh.edu; Fri, 18 Mar 2011 05:22:26 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Q0Wp6-0004UC-Om for ding@lists.math.uh.edu; Fri, 18 Mar 2011 05:22:26 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Q0Wp4-0001ry-Io for ding@gnus.org; Fri, 18 Mar 2011 11:22:22 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q0Wp1-0001mx-MR for ding@gnus.org; Fri, 18 Mar 2011 11:22:19 +0100 Original-Received: from c-67-186-102-106.hsd1.il.comcast.net ([67.186.102.106]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Mar 2011 11:22:19 +0100 Original-Received: from tzz by c-67-186-102-106.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Mar 2011 11:22:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 60 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-67-186-102-106.hsd1.il.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:PXw5UdQDhzWkOgc+4IldxNVEpNY= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:77958 Archived-At: --=-=-= Content-Type: text/plain Lars and anyone else knowledgeable about nntp.el, in nntp.el there are two ways to get the authinfo sent: 1) `nntp-handle-authinfo' -> `nntp-authinfo-function' (used in `nntp-wait-for' and `nntp-async-trigger', uses `nntp-send-authinfo' by default as the `nntp-authinfo-function') 2) `nntp-send-authinfo' used directly (used in `nntp-open-connection') I think the unused choices for `nntp-authinfo-function' (`nntp-send-nosy-authinfo', `nntp-send-authinfo-from-file') should be removed (with whatever extra functionality they have moved to `nntp-send-authinfo') and we should remove `nntp-authinfo-function' itself. We should also remove any dependency on netrc.el. In addition the `auth-source-search' call should query for the virtual server name too, use ":create t", pass `auth-source-creation-defaults' and `auth-source-creation-prompts', and call the :save-function if the login was successful. This is all very similar to the way nnimap.el does the query. I'm attaching a patch to just add the "force" token to nntp.el and will do more of the above if necessary. Let me know. Thanks Ted --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=nntp-force.patch diff --git a/lisp/nntp.el b/lisp/nntp.el index 66a6365..d87f96e 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -1238,7 +1238,6 @@ If SEND-IF-FORCE, only send authinfo to the server if the (require 'netrc) (let* ((list (netrc-parse nntp-authinfo-file)) (alist (netrc-machine list nntp-address "nntp")) - (force (or (netrc-get alist "force") nntp-authinfo-force)) (auth-info (nth 0 (auth-source-search :max 1 ;; TODO: allow the virtual server name too @@ -1249,6 +1248,9 @@ If SEND-IF-FORCE, only send authinfo to the server if the (auth-passwd (if (functionp auth-passwd) (funcall auth-passwd) auth-passwd)) + (force (or (netrc-get alist "force") + nntp-authinfo-force + (plist-get auth-info :force))) (user (or ;; this is preferred to netrc-* auth-user --=-=-=--