Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Option to enter TABLE specific permissions when database name contains _ (underscore) #16477

Closed
Schwuuuuup opened this issue Nov 12, 2020 · 5 comments · Fixed by #16481
Closed
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted
Milestone

Comments

@Schwuuuuup
Copy link

Describe the bug

I was used to grant permissions for single tables instead of permissions for whole databases. For this I opened the useraccount for editing, and klicked on the button "Database" and then on "Table" to select specific Tables for access.
The button "Table" is missing for all Databases with names containing an underscore.

To Reproduce

  1. Rename a database to have its name contain underscores like "test_with_underscore"
  2. Try to grand table specific permissions:
    User accounts->edit permissions->select "Database" button -> see that there does not appear a button "Table"

See Screenshots

Expected behavior

An underscore in the name should not influence what permissions can be granted.
sie examlpes in the screenshots for "testwithoutunderscore"

Screenshots

selectdatabase_without_underscore
selectdatabase_with_underscore
withoutunderscore_button_is_there
with_underscore_button_is_missing

Server configuration

  • Operating system: Red hat Enterprise Linux 7
  • Web server: Apache httpd-2.4.6-95.el7.x86_64
  • Database version: MariaDB-server-10.4.16-1.el7.centos.x86_64
  • PHP version: PHP 7.3.23 (cli) (built: Oct 1 2020 20:38:17) ( NTS )
  • phpMyAdmin version: 5.0.4

Client configuration

  • Browser: Vivaldi
  • Operating system: MX-Linux

Additional context

The Problem must have showed up some time in the past. I guess it was about half a year ago when I last used this feature and back then it worked fine.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Nov 13, 2020
@williamdes williamdes added this to the 5.1.0 milestone Nov 13, 2020
@williamdes
Copy link
Member

Hi @Schwuuuuup !
I can confirm this issue, this is quite strange but I reproduced it.

@shucon would you agree to work on this one ?

@shucon
Copy link
Contributor

shucon commented Nov 14, 2020

Sure!!

@ibennetch
Copy link
Member

I have not looked at the code yet but have a guess as to what's going on. Since a literal underscore is considered a wildcard, it's likely that we aren't properly escaping it here (like \_), or perhaps are escaping it twice. Again, it's just a guess, but that's where I'd start looking at finding a fix.

shucon added a commit to shucon/phpmyadmin that referenced this issue Nov 15, 2020
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@shucon
Copy link
Contributor

shucon commented Nov 15, 2020

I have not looked at the code yet but have a guess as to what's going on. Since a literal underscore is considered a wildcard, it's likely that we aren't properly escaping it here (like \_), or perhaps are escaping it twice. Again, it's just a guess, but that's where I'd start looking at finding a fix.

Thanks @ibennetch , this is exactly what's happening. The database name weren't properly escaped.

@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Nov 15, 2020
shucon added a commit to shucon/phpmyadmin that referenced this issue Nov 15, 2020
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Nov 15, 2020
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Nov 15, 2020
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@williamdes williamdes self-assigned this Nov 15, 2020
@williamdes
Copy link
Member

#16481 (review) is part of the fix made for this issue. Making this issue a double issue.
Now fixed in the next release.

williamdes added a commit that referenced this issue Nov 15, 2020
…ions when database name contains _ (underscore)

Fixes: #16477
Pull-request: #16481
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Nov 15, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Nov 15, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants