about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-01-10 11:18:53 +0000
committerEric Wong <e@80x24.org>2024-01-11 03:00:13 +0000
commitb2daac64423db99db12bd77afe4da813c26ee1b6 (patch)
tree059410968c3b0405f30b44eb3eaeb8b2bcbbe310
parent57b691c79fa97118e963043a0cd1530ec8ddf916 (diff)
downloadpublic-inbox-b2daac64423db99db12bd77afe4da813c26ee1b6.tar.gz
Clearly this was never tested until now, as passwords being
retrieved by git-credential got completely ignored and unused.
This enables users to connect to NNTP(S) servers requiring a
password.
-rw-r--r--lib/PublicInbox/NetReader.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index e3e5d596..751043e9 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -291,7 +291,10 @@ sub nn_for ($$$$) { # nn = Net::NNTP
         return if $self->{quit};
         $nn // die "E: <$uri> new: $@".onion_hint($lei, $uri);
         if ($cred) {
-                $cred->fill($lei) unless defined($p); # may prompt user here
+                $p //= do {
+                        $cred->fill($lei); # may prompt user here
+                        $cred->{password};
+                };
                 if ($nn->authinfo($u, $p)) {
                         push @{$nntp_cfg->{-postconn}}, [ 'authinfo', $u, $p ];
                 } else {