From 7ab68349a8ff7a558e083e5cfda26d86d1e8856c Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 18 May 2008 11:44:13 +0000 Subject: [PATCH 1/1] add extra junk filter --- cgi-bin/register.pl | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/cgi-bin/register.pl b/cgi-bin/register.pl index 158d05e..3c42528 100755 --- a/cgi-bin/register.pl +++ b/cgi-bin/register.pl @@ -83,10 +83,39 @@ if (grep {/rgergerger|\@pgbuildfarm\.org|Content-Type:|http:|mailto:|href=|None| print "Status: 403 Forbidden - go away idiot\n", "Content-Type: text/plain\n\n"; - exit; - + exit; } +# count transitions to and from upper case +my $trans = 1; +my $counttrans = 0; +foreach (split "" ,"$os$osv$comp$compv$arch$owner") +{ + if (/[A-Z]/) + { + next if $trans; + $trans = 1; + $counttrans++; + } + else + { + next unless $trans; + $trans = 0; + $counttrans++; + } +} + +# reject junk with too many transitions into/outof upper case +if ($counttrans > 20) +{ + print + "Status: 403 Forbidden - go away idiot\n", + "Content-Type: text/plain\n\n"; + exit; +} + + + my $secret = ""; my $dummyname=""; # we'll select an animal name when we approve it. foreach (1..8) -- 2.30.2