[vhffs-dev] [502] Bad Gateway.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 502
Author:   beuss
Date:     2007-03-05 13:01:44 +0000 (Mon, 05 Mar 2007)

Log Message:
-----------
Bad Gateway. (yes still in crafty style commits).
Added a check for the postgresql DB Name (potential SQL injection fix).

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Services/Postgres.pm


Modified: trunk/vhffs-api/src/Vhffs/Services/Postgres.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-03-03 09:52:14 UTC (rev 501)
+++ trunk/vhffs-api/src/Vhffs/Services/Postgres.pm	2007-03-05 13:01:44 UTC (rev 502)
@@ -66,7 +66,8 @@
 	
 #    return undef if( $dbname =~ /^[\w\d\_\-]+$/ );
 
-	return undef if( length $dbname > 32 );
+    return undef if( ! ( $dbname =~ /^[a-z0-9][a-z0-9\_]+[a-z0-9]$/ ) );
+    return undef if( length( $dbname ) > 32 );
 
     $this = $class->SUPER::new( $main , 1 , '401' );
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/