Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29834

GRANT OPTION allows to see databases

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • N/A
    • None

    Description

      to see a database, for example, in SHOW DATABASES a user must have at least some privilege on that database. GRANT OPTION is enough:

      GRANT USAGE ON *.* TO user@host WITH GRANT OPTION;
      

      allows to see all databases.

      As GRANT OPTION is not a real privilege, perhaps it shouldn't allow to see databases?

      MySQL Bug#25203933, fixed in 5.7.40 and in 8.0.17

      Attachments

        Issue Links

          Activity

            No. In MySQL (before those mentioned versions) and in MariaDB GRANT OPTION is a real privilege. This is non-standard, indeed, in the standard GRANT OPTION is not a privilege, but a property of a granted privilege. For example, after

            GRANT SELECT ON foo.* TO user@host WITH GRANT OPTION;
            GRANT INSERT ON foo.* TO user@host;
            

            in MySQL and MariaDB the user will have three privileges on the database fooSELECT, INSERT, and GRANT. And will be able to grant them to other users.

            In the standard the user will have two privileges, SELECT and INSERT, and the user will be able to grant SELECT, but not INSERT.

            It would be great to change the semantics of GRANT OPTION to follow the standard, although it'll be a huge break in compatibility.

            But until this is done, GRANT OPTION is a normal privilege and must behave as any other normal privilege. Without hard-coded special behavior that makes it a normal privilege except in SHOW DATABASES (and USE).

            serg Sergei Golubchik added a comment - No. In MySQL (before those mentioned versions) and in MariaDB GRANT OPTION is a real privilege . This is non-standard, indeed, in the standard GRANT OPTION is not a privilege, but a property of a granted privilege. For example, after GRANT SELECT ON foo.* TO user @host WITH GRANT OPTION ; GRANT INSERT ON foo.* TO user @host; in MySQL and MariaDB the user will have three privileges on the database foo — SELECT , INSERT , and GRANT . And will be able to grant them to other users. In the standard the user will have two privileges, SELECT and INSERT , and the user will be able to grant SELECT , but not INSERT . It would be great to change the semantics of GRANT OPTION to follow the standard, although it'll be a huge break in compatibility. But until this is done, GRANT OPTION is a normal privilege and must behave as any other normal privilege. Without hard-coded special behavior that makes it a normal privilege except in SHOW DATABASES (and USE ).

            People

              serg Sergei Golubchik
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.