{"thread":{"id":"60723","subject":"gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142","startedAt":"2024-01-11T08:28:05Z","lastAt":"2024-01-11T08:28:05Z","messageCount":1,"participants":["martin f krafft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"486609","messageId":"20240111082802.ilmtwupekkbxqznw@lotus.rw.madduck.net","threadId":"60723","inReplyTo":null,"subject":"gitweb: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2024-01-11T08:28:02Z","receivedAt":"2024-01-11T08:28:05Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"Hi team,\n\nI get tens of thousands of messages like\n\n```\n[Thu Jan 11 09:01:11 2024] gitweb.cgi: Exiting subroutine via next at /usr/lib/cgi-bin/gitweb.cgi line 3142.\n```\n\nin my logs, presumably from crawlers hitting the CGI wrongly. This \nis using gitweb 2.39.2.\n\nI know no Perl whatsoever, but it's my impression that the following \npatch would solve this:\n\n```\n--- /tmp/gitweb.cgi\t2024-01-11 09:07:47.283764508 +0100\n+++ /usr/lib/cgi-bin/gitweb.cgi\t2024-01-11 09:01:43.459218235 +0100\n@@ -3139,7 +3139,7 @@\n  \t\t\t\tmy $path = substr($File::Find::name, $pfxlen + 1);\n  \t\t\t\t# paranoidly only filter here\n  \t\t\t\tif ($paranoid && $filter && $path !~ m!^\\Q$filter\\E/!) {\n-\t\t\t\t\tnext;\n+\t\t\t\t\treturn;\n  \t\t\t\t}\n  \t\t\t\t# we check related file in $projectroot\n  \t\t\t\tif (check_export_ok(\"$projectroot/$path\")) {\n```\n\nThis is within the wanted sub for `File::Find::find`, and it returns \nnext so as to skip the currently visited file during the tree walk. \nReturning a false value, which `return` without an argument \npresumably does, should have the same effect.\n\nCheers,\n\n-- \nmartin krafft | https://matrix.to/#/#madduck:madduck.net\n \n\"it usually takes more than three weeks\n to prepare a good impromptu speech.\n                                                       -- mark twain\n{: .blockquote }\n \nspamtraps: madduck.bogus@madduck.net\n{: .hidden }\n\n"}]}