Skip to content

Access denied to "SHOW MASTER LOGS" at every login/logout #17452

@gs71

Description

@gs71

Describe the bug

A regular user cannot execute "SHOW MASTER LOGS", so every login/logout produces an error 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 LOGS

To Reproduce

Steps to reproduce the behavior:

  1. Enable the SQL errors log in MariaDB ("sql_error_log_filename" variable)
  2. Login as user with limited privileges (not root)
  3. See error in log file

Expected behavior

No error in log file

Server configuration

  • Operating system: Linux
  • Web server: Apache
  • Database version: MariaDB 10.6.7
  • PHP version: 8.1.2
  • phpMyAdmin version: 5.3.0-dev+20220208.47252f9cf8

Client configuration

  • Browser: any
  • Operating system: any

Additional context

Bug can be fixed by checking for SuperUser privileges in file libraries/classes/Menu.php, line 466:

        if ($isSuperUser) {
            if (SessionCache::has('binary_logs')) {
                $binaryLogs = SessionCache::get('binary_logs');
            } else {
                $binaryLogs = $this->dbi->fetchResult(
                    'SHOW MASTER LOGS',
                    'Log_name'
                );
                SessionCache::set('binary_logs', $binaryLogs);
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA problem or regression with an existing featureaffects/5.2This issue or pull-request affects 5.2.x releases (and maybe further versions)has-prAn issue that has a pull request pending that may fix this issue. The pull request may be incompletepatch

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions