From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 01D421F513 for ; Wed, 10 Jan 2024 11:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1704885536; bh=f53Q2hR1Nfvbqt9VyXuw5QYAOEGsQEg1yEVQCzi2YQc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YrnlciYZw7POUDetNyRWTgIljQJey059fOP3/Mb8a4GIFz+mzTbn56J9SzcZvr08X SKKu5VjjAq56RThdD+2EUP79ktjJgCLdO2MsK6FAHcq0TSHW9Pe4fQVzdVWV1uWKVq X3dYExhy3sJT9uwxB08l5fEUqvl0nx0sxLb6ztbw= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] net_reader: fix NNTP credential use Date: Wed, 10 Jan 2024 11:18:53 +0000 Message-ID: <20240110111855.2656443-2-e@80x24.org> In-Reply-To: <20240110111855.2656443-1-e@80x24.org> References: <20240110111855.2656443-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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. --- lib/PublicInbox/NetReader.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 {