git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MKmartin f krafft <madduck@madduck.net>
Date
Jan 11, 2024, 08:28 UTC
Message-ID
<20240111082802.ilmtwupekkbxqznw@lotus.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 }
Message 1 of 1 in “gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142”
  1. martin f krafftJan 11, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.