-
Notifications
You must be signed in to change notification settings - Fork 277
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
database permission check fails if the database name contains an underscore (during icingaweb2 migrations) #5147
Comments
That'd be #1787 |
MySQL allows to use So a That's why we escape these wildcards in the database name provided by the user. If you drop the grant using the wildcard and issue it again with the underscore escaped, the credentials are properly detected:
|
Oh thanks a lot, that makes sense. Works as intended with the correct grant statement. |
Shouldn't this be fixed with 2.12.1? I had exactly that issue with an upgrade from 2.11.4. |
This doesn't require a fix by us. An underscore shouldn't be used in table names, unless escaped as noted previousy. |
Describe the bug
The database permission check during the new icingaweb2 migrations via the webgui fails if the database name contains an underscore.
It complains that the user is missing permissions, even though they are present:
To Reproduce
icinga_web2
.Expected behavior
The migration should work, as the database user has the required permissions.
Your Environment
icinga2 --version
): r2.14.0-1php --version
): 8.0.30Additional context
The problem is caused by the
escapeTableWildcards()
function, introduced in 0c1365753e.This causes to the
_
in the database name to be escaped as\_
in the SQL statement, which does not match anything - making icingaweb2 believe that the user has no privileges.Unfortunately I cannot find the issue linked in the commit, so I am not sure why
escapeTableWildcards()
was implemented in the first place.The text was updated successfully, but these errors were encountered: