From 7a1997aaf920fa652ee44d8328b4fec7d0164ba4 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 17 Apr 2003 18:50:03 +0000 Subject: [PATCH] bug 722791 --- server_common.inc.php3 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server_common.inc.php3 b/server_common.inc.php3 index b64abfcd9..572d14adb 100644 --- a/server_common.inc.php3 +++ b/server_common.inc.php3 @@ -40,5 +40,14 @@ require('./header.inc.php3'); /** * Checks for superuser privileges */ -$is_superuser = @PMA_mysql_query('SELECT COUNT(*) FROM mysql.user', $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); + +// now, select the mysql db +if ($is_superuser) { + @PMA_mysql_query('USE mysql', $userlink); +} ?>