add extra junk filter
[buildfarm-server.git] / cgi-bin / register.pl
index 7013dea7b76900a4747bf31661ace514fdc698c9..3c42528867b31cafb380d61f11ea60007e8df3c6 100755 (executable)
@@ -78,15 +78,44 @@ unless ($os && $osv && $comp && $compv && $arch && $email && $owner)
 
 # some idiot has a script that tries to talk to me
 # this should catch and dispose of him
-if (grep {/\@pgbuildfarm\.org|Content-Type:|http:|mailto:|href=|None|Unknown/} $os,$osv,$comp,$compv,$arch,$email,$owner)
+if (grep {/rgergerger|\@pgbuildfarm\.org|Content-Type:|http:|mailto:|href=|None|Unknown/} $os,$osv,$comp,$compv,$arch,$email,$owner)
 {
     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)