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

Execute button is disabled for routines #14430

Closed
marcomarsala opened this issue Jun 26, 2018 · 15 comments
Closed

Execute button is disabled for routines #14430

marcomarsala opened this issue Jun 26, 2018 · 15 comments
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
Projects
Milestone

Comments

@marcomarsala
Copy link

marcomarsala commented Jun 26, 2018

Steps to reproduce

  1. Create a stored procedure:
DELIMITER $$
CREATE DEFINER=`wordpress_12`@`localhost` PROCEDURE `Sconto su alloggio`(IN `percentuale` DECIMAL(4,2), IN `anno` SMALLINT, IN `alloggio` VARCHAR(16), IN `fascia` CHAR(5))
    NO SQL
    COMMENT 'Applica sconto percentuale alle fasce di un alloggio'
SELECT 1$$
DELIMITER ;
  1. Grant EXECUTE to another user:
GRANT EXECUTE ON PROCEDURE `wordpress_f2`.`Sconto su alloggio` TO 'hwreport'@'localhost';
  1. Login with that user.

Expected behaviour

Execute button is enabled for the routine.

Actual behaviour

Execute button is disabled for the routine.
image

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache 2.4.18

Database: MySQL 5.7.22

PHP version: 7.1.13

phpMyAdmin version: 4.8.2

Client configuration

Browser: Chrome 67.0.3396.99 (64 bit)

Operating system: Windows 10.0.17134 build 17134

@williamdes
Copy link
Member

@marcomarsala I can not reproduce this issue.
Can you please send the output of:

SHOW CREATE PROCEDURE `wordpress_f2`.`Sconto su alloggio`;

@williamdes williamdes added the question Used when we need feedback from the submitter or when the issue is a question about PMA label Nov 27, 2018
@marcomarsala
Copy link
Author

image

This happens with user with only EXECUTE permission.

image

@williamdes williamdes added Bug A problem or regression with an existing feature help wanted and removed question Used when we need feedback from the submitter or when the issue is a question about PMA labels Nov 30, 2018
@bahl24
Copy link
Contributor

bahl24 commented Jan 9, 2019

@marcomarsala Which lang pack are you using, I am having difficulty reproducing the issue?

@bahl24
Copy link
Contributor

bahl24 commented Jan 10, 2019

I was able to successfully replicate the issue, and yes the 'Execute' button is not active.

@bahl24
Copy link
Contributor

bahl24 commented Jan 10, 2019

@williamdes @marcomarsala @ibennetch Though 'execute' button is inactive but I am able to CALL the procedure both from system terminal as well as console given on phpMyAdmin page.
execute button inactive
call from console
I am a new to phpMyAdmin development but would like to work on this issue
(Note - I modified the names to English as I can't understand Italian)

@bahl24
Copy link
Contributor

bahl24 commented Jan 10, 2019

I’d like to try fixing this.

@williamdes
Copy link
Member

@bahl24 Go ahead ;)

@bahl24
Copy link
Contributor

bahl24 commented Jan 13, 2019

@williamdes @ibennetch @MauricioFauth
I worked on this issue and found that error is in Util::currentUserHasPrivilege due to which execute button is not displayed. Infact, it has been already mentioned in the following comment
14430_2

bahl24 added a commit to bahl24/phpmyadmin that referenced this issue Jan 13, 2019
bahl24 added a commit to bahl24/phpmyadmin that referenced this issue Jan 13, 2019
Signed-off-by: nitish <nitishbahl24@gmail.com>
@bahl24
Copy link
Contributor

bahl24 commented Jan 13, 2019

This is not a permanent fix for the issue but in order to justify
There is a problem with Util::currentUserHasPrivilege(): // There is a problem with Util::currentUserHasPrivilege(): // it does not detect all kinds of privileges, for example // it does not detect all kinds of privileges, for example // a direct privilege on a specific routine. So, at this point, // a direct privilege on a specific routine. So, at this point, // we show the Execute link, hoping that the user has the correct rights.

this fix is the only solution until Util::currentUserHasPrivilege() is fully fixed

bahl24 referenced this issue in bahl24/phpmyadmin Jan 20, 2019
Signed-off-by: nitish <nitishbahl24@gmail.com>
bahl24 pushed a commit to bahl24/phpmyadmin that referenced this issue Jan 20, 2019
Signed-off-by: Nitish Bahl <nitishbhal24@gmail.com>
@bahl24 bahl24 mentioned this issue Jan 20, 2019
6 tasks
@williamdes williamdes added this to To be sorted in issues May 2, 2019
@williamdes williamdes moved this from To be sorted to Reproduced in issues May 3, 2019
@victorphoenix3
Copy link
Contributor

will try to debug this

@victorphoenix3
Copy link
Contributor

@williamdes The issue lies with getDefinition function in DatabaseInterface.php which returns a false for every user who is not named in the DEFINER clause for the procedure. Thus, execute button is not available even the user has privileges.

will it be right to override this function ?

@williamdes
Copy link
Member

will it be right to override this function ?

From what I understand It would be right

victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 23, 2020
fixes phpmyadmin#14430
Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
@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 Jan 23, 2020
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 23, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 23, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
@williamdes
Copy link
Member

CALL `Sconto su alloggio`(1, 1, 1, 1);

victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 25, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 25, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 25, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
williamdes pushed a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 27, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Jan 30, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
victorphoenix3 added a commit to victorphoenix3/phpmyadmin that referenced this issue Feb 1, 2020
fixes phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
williamdes pushed a commit to victorphoenix3/phpmyadmin that referenced this issue Aug 10, 2020
Fixes: phpmyadmin#14430

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
@williamdes williamdes removed the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Aug 10, 2020
@rajat315315
Copy link
Contributor

Fixed.

@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 Sep 24, 2020
@williamdes williamdes added this to the 5.1.0 milestone Nov 2, 2020
@williamdes williamdes removed this from the 5.1.0 milestone Feb 9, 2021
@williamdes
Copy link
Member

I could not validate any PR done for this issue. And I tried many versions and even 5.7.22.
Please help me
image

Using a docker image from the hub with a basic user. (And also tested with users I created)

@williamdes williamdes linked a pull request Feb 9, 2021 that will close this issue
@williamdes williamdes self-assigned this Mar 22, 2021
williamdes added a commit that referenced this issue Mar 23, 2021
#16703

Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed Mar 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2022
@williamdes williamdes added this to the 5.1.1 milestone Oct 29, 2022
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
issues
  
Closed
5 participants