[MDEV-19704] GRANT EXECUTE lower procedure name Created: 2019-06-06  Updated: 2019-07-21  Resolved: 2019-07-21

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System, Data Definition - Procedure
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: David Villalobos Cambronero Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Linux


Attachments: PNG File image-2019-06-06-08-26-10-111.png    

 Description   

If you create a function or procedure, on GRANT MariaDB lower its name so the user will not have the privilege to execute ir.

DELIMITER |
DROP FUNCTION IF EXISTS FUNCTION `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar`; |
CREATE DEFINER = CURRENT_USER() FUNCTION `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar`() RETURNS TINYINT UNSIGNED
BEGIN
RETURN 1;
END; |
GRANT EXECUTE ON FUNCTION `ERPUniversitario`.`faBecas_ResolucionesDetalleAprobar` TO 'ERPUniversitario'@'10.100.20.0/255.255.255.0'; |
SHOW GRANTS FOR 'ERPUniversitario'@'10.100.20.0/255.255.255.0'; |
DELIMITER ;



 Comments   
Comment by Elena Stepanova [ 2019-06-17 ]

Please connect as the user in question, try to execute the function, get the error, run SHOW GRANTS without parameters, and paste or attach the whole unabridged output from the console.

Comment by David Villalobos Cambronero [ 2019-06-18 ]

Hi Elena,

I have found what is going on:

1 - GRANT EXECUTE ON FUNCTION ... lowers the case of the name, but the user can execute the routine.
2 - In my case the error was a custom SIGNAL SQLSTATE implemented on the function since the user do not have privileges to execute a SIGNAL.
3 - So, the name of the function is lower case, but it can be executed, therefore there is no error.
4 - Now I am trying to find what privileges are need for a user to execute a SIGNAL command.

At the end, sorry for wasting your time and thanks for the interest.

Best regards
David

Generated at Thu Feb 08 08:53:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.