* gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142
@ 2024-01-11 8:28 martin f krafft
0 siblings, 0 replies; only message in thread
From: martin f krafft @ 2024-01-11 8:28 UTC (permalink / raw)
To: git
Hi team,
I get tens of thousands of messages like
```
[Thu Jan 11 09:01:11 2024] gitweb.cgi: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142.
```
in my logs, presumably from crawlers hitting the CGI wrongly. This
is using gitweb 2.39.2.
I know no Perl whatsoever, but it's my impression that the following
patch would solve this:
```
--- /tmp/gitweb.cgi 2024-01-11 09:07:47.283764508 +0100
+++ /usr/lib/cgi-bin/gitweb.cgi 2024-01-11 09:01:43.459218235 +0100
@@ -3139,7 +3139,7 @@
my $path = substr($File::Find::name, $pfxlen + 1);
# paranoidly only filter here
if ($paranoid && $filter && $path !~ m!^\Q$filter\E/!) {
- next;
+ return;
}
# we check related file in $projectroot
if (check_export_ok("$projectroot/$path")) {
```
This is within the wanted sub for `File::Find::find`, and it returns
next so as to skip the currently visited file during the tree walk.
Returning a false value, which `return` without an argument
presumably does, should have the same effect.
Cheers,
--
martin krafft | https://matrix.to/#/#madduck:madduck.net
"it usually takes more than three weeks
to prepare a good impromptu speech.
-- mark twain
{: .blockquote }
spamtraps: madduck.bogus@madduck.net
{: .hidden }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-11 8:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11 8:28 gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142 martin f krafft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).