Menu

#1962 (in 2.7.1) Username with hyphen and Create Database

2.7.0-pl2
fixed
Privileges (64)
1
2013-06-11
2006-01-15
timeout
No

When using phpmyadmin towards
MySQL < 40102 and the username contains an "-" i
get "No Privileges" on the main.php page for create
databases.

I found the error in
libraries/check_user_privileges.lib.php on row 158.
($rs_usr = PMA_DBI_try_query('SHOW GRANTS FOR ' .
$mysql_cur_user . ';', $dbh, PMA_DBI_QUERY_STORE);)

The $mysql_cur_user needs to be quoted for it to work
if it contains a "-".

My solution is to change $mysql_cur_user to :
PMA_convert_using(PMA_sqlAddslashes($mysql_cur_user),
'quoted')
As its beeing done earlier in the code :)

Discussion

  • Marc Delisle

    Marc Delisle - 2006-01-16
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2006-01-16

    Logged In: YES
    user_id=210714

    Merged your fix, thanks.

     
  • Marc Delisle

    Marc Delisle - 2006-01-16
    • priority: 5 --> 1
    • summary: Create Database = No privileges --> (in 2.7.1) Username with hyphen and Create Database
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2006-03-06
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed