# gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142

1 messages from 2024-01-11 to 2024-01-11. Participants: martin f krafft.
Thread: https://gitlist.dev/t/60723

## martin f krafft, 2024-01-11 08:28

Subject: gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142
Message-ID: <20240111082802.ilmtwupekkbxqznw@lotus.rw.madduck.net>
URL: https://gitlist.dev/e/20240111082802.ilmtwupekkbxqznw%40lotus.rw.madduck.net

```
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 }


```
