Gnus development mailing list
 help / color / mirror / Atom feed
* nntp.el authinfo calls need fixin'
@ 2011-03-18 10:22 Ted Zlatanov
  2011-03-29 18:51 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Ted Zlatanov @ 2011-03-18 10:22 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nntp-force.patch --]
[-- Type: text/x-diff, Size: 933 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: nntp.el authinfo calls need fixin'
  2011-03-18 10:22 nntp.el authinfo calls need fixin' Ted Zlatanov
@ 2011-03-29 18:51 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 18:51 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> 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.

Yes, I agree.

> 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.

Yup.

> 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.

Please apply.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-29 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-18 10:22 nntp.el authinfo calls need fixin' Ted Zlatanov
2011-03-29 18:51 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).