fixed bug #576896 - No "FILE" privileges on a database if neither "INSERT" nor "UPDATE" one

This commit is contained in:
Loïc Chapeaux 2002-08-10 12:56:58 +00:00
parent 0738b17033
commit b834fbc15f
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,8 @@ $Source$
* config.inc.php3: coding standards.
* db_details.php3; db_details_qbe.php3; tbl_change.php3;
tbl_query_box.php3: fixed bug #592000 (dir="ltr" for textarea tags).
* user_details.php3, lines 90-95: fixed bug #576896 - No "FILE" privileges
on a database if neither "INSERT" nor "UPDATE" one.
2002-08-09 Marc Delisle <lem9@users.sourceforge.net>
* user_details.php3: bug 591602, mysql.user lowercase "password",

View File

@ -82,11 +82,17 @@ function PMA_tableGrants(&$host_db_result, $dbcheck = FALSE) {
$i = 0;
while ($usr_row = PMA_mysql_fetch_row($result)) {
if (eregi('GRANT (.*) ON ([^.]+).([^.]+) TO .*$', $usr_row[0], $parts)) {
// loic1: bug #487673 - revoke 'reference'
if ($parts[1] == 'USAGE') {
$priv = '';
} else {
// loic1: bug #487673 - revoke 'reference'
$priv = ereg_replace('REFERENCE([^S]|$)', 'REFERENCES\\1', trim($parts[1]));
// loic1: bug #576896 - No "FILE" privileges on a
// database if neither "INSERT" nor "UPDATE" one
if (strpos(' ' . $priv, 'FILE')
&& !(strpos(' ' . $priv, 'INSERT') || strpos(' ' . $priv, 'UPDATE'))) {
$priv = ereg_replace('(^FILE(, )?)|(, FILE)', '', $priv);
}
}
$db = $parts[2];
$table = trim($parts[3]);