-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Grant fails if symbol privilege contains an underscore #243
Comments
Hi @dud225 Would you be willing to create a PR for this issue, then we can get released quickly 👍 |
I don't initally wrote the part of the cookbook... But what i can tell is that underscore ARE supported by MariaDB. It came from Mysql, please see here for details. So yes, show_view is not supported as is... But Show_view_priv is, and the cookbook normally change show_view to Show_view_priv here But seems there's a bug in the grant function, as we don't use the good variable here So i'd prefer to correct the bug in grant method that convert the whole cookbook to upper case privilege. |
From my reading of the doc, it is not clear to me that the "_priv" syntax is supported. I nevertheless tested your suggestion but was not successful : MariaDB [(none)]> GRANT select_priv ON *.* TO 'root'@'localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON *.* TO 'root'@'localhost'' at line 1
MariaDB [(none)]> GRANT Select_priv ON *.* TO 'root'@'localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON *.* TO 'root'@'localhost'' at line 1
MariaDB [(none)]> GRANT show_view_priv ON *.* TO 'root'@'localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON *.* TO 'root'@'localhost'' at line 1
MariaDB [(none)]> GRANT Show_view_priv ON *.* TO 'root'@'localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON *.* TO 'root'@'localhost'' at line 1 Are you able to make it work on your side ? |
Ok, after reading my post, i see i'm far from having said, what i had to. I won't edit it, to let your question understandable. I wrote english, but think in french, and so the result is wrong. What i REALLY mean (i hope to be clear this time, but i can't give warranty ;-) ): show_view is not supported in the GRANT request... But we always compare the result of the column So the misunderstanding is on the way we try to find if we need to really use the GRANT request, or if all grants are ok. If you see the revoke function, we use the method revokify_key to grab the good GRANT name from the column name of the good right we want. To my opinion, we just need to change the variable new_resource.privileges by a one which is cleaned via the revokify_key method (by the way also changing the revokify_key name to something clearer like get_clean_grant_right_name) Sorry for my bad post before. I'm trying to improve myself :) |
Thanks for your detailed message I think I've got your point. |
This time, i have a clear answer ! In many audit system, all grant request are logged with a special importance. If you play it as it's not needed, it generate noises on your audit system. The original author of these code is @stissot, perhaps he can add some more insight on his own needs. |
Hello @sinfomicien I feel that adding this kind of overhead to the whole community for constraints you have in a specific environment is quite awkward. It makes the resource code more complex that it needs to be and even though it let your audit system be happy it makes the server executes twice as much queries. Yet this has a nice side-effect : it probably makes the cookbook work on AWS RDS (I haven't tested for now) as the user we get can't get "ALL PRIVILEGES". See this article for more details. Anyway I did a new PR with your suggestion, let me know what you think about this one. |
Hey @sinfomicien what was the outcome of checking on this one? |
Hello
the manual implies that we can express grant privileges with symbols :
the full list can be found here
However MariaDB doesn't allow granting privileges containing an undersocre :
So using :
makes the cookbook fail.
To grant that permission, one has to write :
I suggest the manual be updated to explicitely use a string representing the usual uppercase form.
The text was updated successfully, but these errors were encountered: