web installer: improve DB permissions check

MySQL-only: improve regex to make sure we are
checking permission on the correct database, not
on another database (when the DB name is a
subset of the DB user's name)
This commit is contained in:
Galen Charlton 2007-12-14 16:32:43 -06:00
parent 3f5c71daa5
commit 17e4626dff

View file

@ -188,7 +188,7 @@ elsif ( $step && $step == 2 ) {
my $grantaccess;
while ( my ($line) = $rq->fetchrow ) {
my $dbname = $info{dbname};
if ( $line =~ m/$dbname/ || index( $line, '*.*' ) > 0 ) {
if ( $line =~ m/^GRANT (.*?) ON `$dbname`\.\*/ || index( $line, '*.*' ) > 0 ) {
$grantaccess = 1
if (
index( $line, 'ALL PRIVILEGES' ) > 0