From: Eric Wong Date: Mon, 13 Sep 2021 20:53:53 +0000 (+0000) Subject: lei up: localize %ENV in redispatch X-Git-Tag: v1.7.0~388 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bd45b7f640382cfaa585845018bd95adc0f32ce1;p=public-inbox.git lei up: localize %ENV in redispatch We need to restore %ENV of script/lei in case another lei client has a different %ENV than what daemon has. --- diff --git a/lib/PublicInbox/LeiUp.pm b/lib/PublicInbox/LeiUp.pm index be476427..a16117c9 100644 --- a/lib/PublicInbox/LeiUp.pm +++ b/lib/PublicInbox/LeiUp.pm @@ -55,13 +55,14 @@ sub up1 ($$) { sub up1_redispatch { my ($lei, $out, $op_p) = @_; my $l = bless { %$lei }, ref($lei); - $l->{opt} = { %{$l->{opt}} }; + $l->{opt} = { %{$l->{opt}} }; # deep copy delete $l->{sock}; # do not close $l->{''} = $op_p; # daemon only ($l => $lei => script/lei) # make close($l->{1}) happy in lei->dclose open my $fh, '>&', $l->{1} or return $l->child_error(0, "dup: $!"); local $PublicInbox::LEI::current_lei = $l; + local %ENV = %{$l->{env}}; $l->{1} = $fh; eval { $l->qerr("# updating $out");