-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
BugA problem or regression with an existing featureA problem or regression with an existing featureaffects/5.2This issue or pull-request affects 5.2.x releases (and maybe further versions)This issue or pull-request affects 5.2.x releases (and maybe further versions)confirmed/5.2This issue is confirmed to be reproduced on 5.2 at the time this label was setThis issue is confirmed to be reproduced on 5.2 at the time this label was sethas-prAn issue that has a pull request pending that may fix this issue. The pull request may be incompleteAn issue that has a pull request pending that may fix this issue. The pull request may be incompletepatch
Description
Describe the bug
A regular user cannot execute "SHOW MASTER/SLAVE STATUS", so every click on the "Databases" or "Status" tab produces 2 errors in the SQL error log (if enabled):
Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation : SHOW MASTER STATUS
Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation : SHOW SLAVE STATUS
To Reproduce
Steps to reproduce the behavior:
- Enable the SQL errors log ("sql_error_log_filename" variable)
- Login as user with limited privileges (not root) and click on the "Databases" or "Status" tab
- See errors in log file
Expected behavior
No errors in log file.
Server configuration
- Operating system: Linux
- Web server: Apache
- Database version: MariaDB 10.6.7
- PHP version: PHP 8.1.2
- phpMyAdmin version: 5.3.0-dev+20220208.47252f9cf8
Client configuration
- Browser: any
- Operating system: any
Additional context
I think the bug could be fixed by checking for SuperUser access level in file libraries/classes/ReplicationInfo.php line 85, something like:
if ($this->dbi->isSuperUser()) {
$this->setPrimaryStatus();
if (! empty($connection)) {
$this->setMultiPrimaryStatus();
if ($this->multiPrimaryStatus) {
$this->setDefaultPrimaryConnection($connection);
$urlParams['primary_connection'] = $connection;
}
}
$this->setReplicaStatus();
$this->setPrimaryInfo();
$this->setReplicaInfo();
} else {
$this->primaryStatus = '?';
$this->multiPrimaryStatus = '?';
$this->replicaStatus = '?';
$this->primaryInfo = ['status' => false];
$this->replicaInfo = ['status' => false];
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA problem or regression with an existing featureA problem or regression with an existing featureaffects/5.2This issue or pull-request affects 5.2.x releases (and maybe further versions)This issue or pull-request affects 5.2.x releases (and maybe further versions)confirmed/5.2This issue is confirmed to be reproduced on 5.2 at the time this label was setThis issue is confirmed to be reproduced on 5.2 at the time this label was sethas-prAn issue that has a pull request pending that may fix this issue. The pull request may be incompleteAn issue that has a pull request pending that may fix this issue. The pull request may be incompletepatch