about summary refs log tree commit homepage
path: root/lib/PublicInbox/NetReader.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-10 09:08:49 +0000
committerEric Wong <e@80x24.org>2021-09-10 09:18:37 +0000
commit9d11ed460ce113dd10cd098e2dfa814fcfbddde9 (patch)
treea733b03c4bf2cfc6ae1a070f3938b820c6900747 /lib/PublicInbox/NetReader.pm
parentc1b44ad0a8901a488063c35eb2fe81cd6e051933 (diff)
downloadpublic-inbox-9d11ed460ce113dd10cd098e2dfa814fcfbddde9.tar.gz
Since ~/.netrc isn't widely used by most (if any) NNTP and IMAP
clients, we won't read it by default for lei.  AFAIK, ~/.netrc
is mainly by FTP clients (e.g. ftp(1) and lftp(1)).  wget uses
it by default for HTTP(S) (and FTP), but curl does not.

To avoid breaking stable release use cases, public-inbox-watch
continues to read ~/.netrc by default.

The --netrc switch is supported by all existing lei commands
which may use curl.
Diffstat (limited to 'lib/PublicInbox/NetReader.pm')
-rw-r--r--lib/PublicInbox/NetReader.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index a0e52fc5..f0f56431 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -96,7 +96,7 @@ sub mic_for ($$$$) { # mic = Mail::IMAPClient
                 $cred = undef;
         }
         if ($cred) {
-                my $p = $cred->{password} // $cred->check_netrc;
+                my $p = $cred->{password} // $cred->check_netrc($lei);
                 $cred->fill($lei) unless defined($p); # may prompt user here
                 $mic->User($mic_arg->{User} = $cred->{username});
                 $mic->Password($mic_arg->{Password} = $cred->{password});
@@ -191,7 +191,7 @@ sub nn_for ($$$$) { # nn = Net::NNTP
                 }, 'PublicInbox::GitCredential';
                 ($u, $p) = split(/:/, $ui, 2);
                 ($cred->{username}, $cred->{password}) = ($u, $p);
-                $p //= $cred->check_netrc;
+                $p //= $cred->check_netrc($lei);
         }
         my $common = $nn_common->{$sec} // {};
         my $nn_arg = {