MySQL4 global privs and USE mysql

This commit is contained in:
Marc Delisle
2003-03-25 11:29:20 +00:00
parent 02616368ed
commit 70acc9454f
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-03-25 Marc Delisle <lem9@users.sourceforge.net>
* main.php3: replace the 'USE mysql' test, as users with a global
priv like CREATE TEMPORARY TABLES can do a 'USE mysql'
2003-03-25 Michal Cihar <nijel@users.sourceforge.net>
* tbl_query_box.php3, tbl_properties_operations.php3,
libraries/common.lib.php3, tbl_query_box.php3, querywindow.php3: More

View File

@@ -181,7 +181,11 @@ if ($server > 0) {
$is_create_priv = FALSE;
$is_process_priv = TRUE;
$is_reload_priv = FALSE;
$is_superuser = @PMA_mysql_query('USE mysql', $userlink);
// We were checking privileges with 'USE mysql' but users with the global
// priv CREATE TEMPORARY TABLES or LOCK TABLES can do a 'USE mysql'
// (even if they cannot see the tables)
$is_superuser = @PMA_mysql_query('SELECT COUNT(*) FROM mysql.user', $userlink);
if ($dbh) {
$local_query = 'SELECT Create_priv, Process_priv, Reload_priv FROM mysql.user WHERE User = \'' . PMA_sqlAddslashes($mysql_cur_user) . '\'';
$rs_usr = PMA_mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);