]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_pmdir: do not attempt to trigger network auth
authorEric Wong <e@80x24.org>
Thu, 16 Sep 2021 20:15:20 +0000 (14:15 -0600)
committerEric Wong <e@80x24.org>
Thu, 16 Sep 2021 20:17:16 +0000 (20:17 +0000)
Since some commands access both Maildirs and IMAP/NNTP servers
at the same time, LeiPmdir may see the same lei->{auth} and
lei->{net} objects as the sibling LeiInput-based workers.
Delete those at fork and do not attempt to do authentication in
those cases, since "net_merge_continue" will not be a registered
op and cause PktOp to fail even if authentication /can/ work
from a LeiPmdir worker.

lib/PublicInbox/LeiPmdir.pm

index 59cf886e1526854db0755429b59ac2dba445e8aa..23bccb4f0c962830f02172911830bfbd368b7437 100644 (file)
@@ -32,7 +32,8 @@ sub new {
 sub ipc_atfork_child {
        my ($self) = @_;
        my $ipt = $self->{ipt} // die 'BUG: no self->{ipt}';
-       $ipt->{lei} = $self->{lei};
+       my $lei = $ipt->{lei} = $self->{lei};
+       delete @$lei{qw(auth net)}; # no network access in this worker
        $ipt->ipc_atfork_child; # calls _lei_atfork_child;
 }