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

Trial Approach to solve privileges bug for RFE#657 #1772

Merged
merged 2 commits into from Jul 3, 2015

Conversation

devenbansod
Copy link
Member

Bug description:
Adjusting privileges implementation requires SELECT, INSERT, UPDATE, DELETE privileges on mysql.db, mysql.cols_priv, mysql.tables_priv, mysql.procs_priv
And FLUSH privilege for reloading the privileges.
If user without these privileges, tries to adjust privileges while copying/ renaming/ moving db, table, columns, procedures then the operation might not give complete properly and gives an access denied error.

Approach:
Try making similar queries that we are going to need to make while adjusting the privileges.
If any of these fail, means that the user does not have enough privileges to perform this action.

So, while we display the checkbox field for 'Adjust Privileges', we check if user has required privileges. If he/she does not possess the required privileges, then we display a disabled checkbox with a tooltip explaining the situation.

Signed-off-by: Deven Bansod devenbansod.bits@gmail.com

@devenbansod devenbansod force-pushed the 657Correction branch 4 times, most recently from 5cd3edc to d014dbc Compare July 1, 2015 11:29
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
@ibennetch ibennetch self-assigned this Jul 3, 2015
@ibennetch
Copy link
Member

I like this improvement. Thanks.

ibennetch added a commit that referenced this pull request Jul 3, 2015
Improvements to Adjust Privileges RFE #657; disables the checkbox when a user lacks sufficient privileges.
@ibennetch ibennetch merged commit 6fc448b into phpmyadmin:master Jul 3, 2015
@ibennetch
Copy link
Member

Deven, good research on this issue. Nice work.

@devenbansod devenbansod deleted the 657Correction branch July 3, 2015 15:30
@ibennetch
Copy link
Member

I now get a notice when going to the Structure page and clicking Change for an existing column:

Notice in ./libraries/tbl_columns_definition_form.inc.php#338
Undefined variable: privs_available
Backtrace
./libraries/structure.lib.php#2495: include(./libraries/tbl_columns_definition_form.inc.php)
./tbl_structure.php#83: PMA_displayHtmlForColumnChange(
string 'stack',
string '1',
NULL,
string 'tbl_structure.php',
)

I believe it's related to these commits, could you take a look?

@devenbansod
Copy link
Member Author

Hi,
Sorry I could not look into this earlier.

Anyways Madhura fixed this issue due to an extra unused parameter, in this commit : 944166d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants