about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-11-22 18:38:09 +0000
committerEric Wong <e@80x24.org>2021-11-22 21:36:50 +0000
commit10e0e2052b2c2a4bb405cfbb4c2c72464671152d (patch)
tree6cbb9322deeb41d5b1f2e86b07e07d0e37981e2e /lib/PublicInbox
parent74f027ca317067f7ae7289b15465d6a49078f65c (diff)
downloadpublic-inbox-10e0e2052b2c2a4bb405cfbb4c2c72464671152d.tar.gz
Future-proofing in case future versions of Perl warn on this, since
2-arg forms of open may be subject to injection vulnerabilities
with non-literal args.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LEI.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 192f267c..4e0295fa 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -818,7 +818,8 @@ sub dispatch {
                                 next if $d eq ''; # same as git(1)
                                 chdir $d or return fail($self, "cd $d: $!");
                         }
-                        open $self->{3}, '.' or return fail($self, "open . $!");
+                        open $self->{3}, '<', '.' or
+                                return fail($self, "open . $!");
                 }
                 $cb->($self, @argv);
         } elsif (grep(/\A-/, $cmd, @argv)) { # --help or -h only