From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: nntp.el authinfo calls need fixin'
Date: Fri, 18 Mar 2011 05:22:08 -0500 [thread overview]
Message-ID: <87aagswwxb.fsf@lifelogs.com> (raw)
[-- 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
next reply other threads:[~2011-03-18 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 10:22 Ted Zlatanov [this message]
2011-03-29 18:51 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aagswwxb.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).