add extra junk filter
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 18 May 2008 11:44:13 +0000 (11:44 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 18 May 2008 11:44:13 +0000 (11:44 +0000)
cgi-bin/register.pl

index 158d05e822dc1d4d5187a8a393b30c2e07dd238e..3c42528867b31cafb380d61f11ea60007e8df3c6 100755 (executable)
@@ -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";
     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)
 my $secret = "";
 my $dummyname=""; # we'll select an animal name when we approve it.
 foreach (1..8)