summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-14443: Ignore denies privilege now takes effectvicentiu-tmpVicențiu Ciorbaru2022-09-205-24/+52
|
* MDEV-14443: Show grants denies for routinesVicențiu Ciorbaru2022-09-203-6/+135
|
* Extend protocol to accept a const String & as an argument for storeVicențiu Ciorbaru2022-09-201-0/+2
|
* refactor: Extract the printing of routine grants to separate functionVicențiu Ciorbaru2022-09-201-46/+55
| | | | | | Almost no logic changes except for 1: * Printing the hostname uses the user's hostname instead of the routine's hostname
* MDEV-14443: SHOW GRANTS Sort column level denies lexicographicallyVicențiu Ciorbaru2022-09-202-1/+7
|
* MDEV-14443: SHOW GRANTS for table and column deniesVicențiu Ciorbaru2022-09-203-0/+248
| | | | | | | This commit introduces the logic to show denies for table and column TODO: more test cases, more showing only denies that don't leak object information
* Refactor: cleanup Deny_spec::get_hash_entryVicențiu Ciorbaru2022-09-201-26/+59
| | | | | * Remove code duplication and reuse functions. * my_hash_get_key -> pair_first_key now a template function, made public
* Fix Deny_spec::deconstruct_identifier (set LEX_CSTRING::length properly)Vicențiu Ciorbaru2022-09-201-1/+2
|
* Expand Hash_set API to allow searching by T type, not just key.Vicențiu Ciorbaru2022-09-201-0/+8
|
* cleanup: Hash_set::insert need not take in a non-const TVicențiu Ciorbaru2022-09-201-1/+1
| | | | During insert, the value isn't mutated so we can accept a const ptr.
* cleanup: Dynamic_array is not copy-ableVicențiu Ciorbaru2022-09-202-3/+13
| | | | | Delete the copy constructor for Dynamic_array and use proper move semantics for acl_dbs.
* cleanup: Protocol::store can take in a const StringVicențiu Ciorbaru2022-09-201-1/+1
| | | | The String isn't mutated so it can be marked as const.
* cleanup: rename command_array to privilege_str_reprVicențiu Ciorbaru2022-09-203-56/+72
| | | | | | command_array wasn't particularly meaningful as a name. Also use LEX_CSTRING instead of 2 separate arrays.
* Fix warning in perfschemaVicențiu Ciorbaru2022-09-201-1/+1
| | | | | | | The *ptr could end up dereferencing to an invalid memory address if the function's parameter is ill-formed. Adjust the where clause to ensure that can not happen.
* Update test results (stabilize order and updated version)Vicențiu Ciorbaru2022-09-202-3/+11
|
* MDEV-14443: Test role global level deniesVicențiu Ciorbaru2022-09-202-0/+85
|
* UPDATE MDEV-29465 test case for newest version of MariaDBVicențiu Ciorbaru2022-09-201-0/+2
|
* MDEV-29509 execute granted indirectly (via roles) doesn't always workVicențiu Ciorbaru2022-09-203-11/+10
| | | | | | | | | | | | | | | | | | | The issue manifests due to a bug in mysql_routine_grant. This was a side effect of e46eea8660fb which fixed the problem of not giving appropriate error message (ER_NONEXISTING_PROC_GRANT) when a routine grant existed due to role inheritance. When granting a routine privilege, it is possible to have a GRANT_NAME entry already created from an inherited role, but with it's init_privs set to 0. In this case we must not create a *new* grant entry, but we must edit this grant entry to set its init_privs. Note that this case was already covered by MDEV-29458, however due to a forgotten "flush privileges;" the actual code path never got hit. Remove the flush privilege command as it was never intended to be there in the first place.
* MDEV-29458: Role grant commands do not propagate all grantsVicențiu Ciorbaru2022-09-204-102/+414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an issue in updating in-memory role datastructures when propagating role grants. The issue is that changing a particular role's privilege (on any privilege level, global, database, etc.) was done such that it overwrote the entire set of bits for that particular level of privileges. For example: grant select on *.* to r1 -> sets the access bits to r1 to select, regardless of what bits were present for role r1 (inherited from any other roles). Before this fix, the rights of role r1 were propagated to any roles r1 was granted to, however the propagated rights did *not* include the complete rights r1 inherited from its own grants. For example: grant r2 to r1; grant select on *.* to r2; grant insert on *.* to r1; # This command completely disregards the # select privilege from r2. In order to correct this, ensure that before rights are propagated onwards, that the current's role rights have been updated from its grants. Additionally, the patch exposed a flaw in the DROP ROLE code. When deleting a role we removed all its previous grants, but what remained was the actual links of roles granted to the dropped role. Having these links present when propagating grants meant that we would have leftover ACL_xxx entries. Ensure that the links are removed before propagating grants.
* MDEV-29465: Inherited columns privs for roles wrongly set mysql.tables_priv ↵Vicențiu Ciorbaru2022-09-203-9/+90
| | | | | | | | | | | | | | | | | | column There was a bug in the ACL internal data structures GRANT_TABLE and GRANT_COLUMN. The semantics are: GRANT_TABLE::init_cols and GRANT_COLUMN::init_privs represent the bits that correspond to the privilege bits stored in the physical tables. The other struct members GRANT_TABLE::cols and GRANT_COLUMN::privs represent the actual access bits, as they may be modified through role grants. The error in logic was mixing the two fields and thus we ended up storing the logical access bits in the physical tables, instead of the physical (init_xxx) bits. This caused subsequent DBUG_ASSERT failures when dropping the involved roles.
* Fix CentOS7 warningVicențiu Ciorbaru2022-09-201-3/+12
|
* Fix windowsVicențiu Ciorbaru2022-09-201-2/+2
|
* Update perfschema digest testsVicențiu Ciorbaru2022-09-201-1/+1
|
* SHOW GRANTS now works with database denies (users and roles)Vicențiu Ciorbaru2022-09-208-115/+454
|
* WIP: Show grants initial cleanupVicențiu Ciorbaru2022-09-203-12/+83
| | | | Includes WIP test case
* Fix segfault for roles updatingVicențiu Ciorbaru2022-09-201-4/+7
|
* cleanup: Fix indentationVicențiu Ciorbaru2022-09-201-3/+3
|
* Memory leaks for roles fixedVicențiu Ciorbaru2022-09-201-1/+2
|
* Fix role privilege mergingVicențiu Ciorbaru2022-09-204-35/+46
|
* ROLE global denies work with set role and set role noneVicențiu Ciorbaru2022-09-206-53/+155
|
* INFORMATION_SCHEMA.views denies with show view and selectVicențiu Ciorbaru2022-09-208-70/+399
| | | | | | | | | | | This commit fixes show view and select privilege denies. Other cleanup work: - TODO(cvicentiu) describe this when rebasing. - get_table_grant -> Take in table strings, not a TABLE_LIST - get_column_grant -> Take in sctx. - check_some_grants_remain -> take in role denies. - check_column_access_denied -> Utility function for show view.
* fix compilation for embeddedVicențiu Ciorbaru2022-09-205-15/+24
|
* WIP - Show grants + rolesVicențiu Ciorbaru2022-09-206-261/+292
|
* Fix show_generic VERSIONVicențiu Ciorbaru2022-09-202-1/+3
|
* Fix sp_denies.test VERISONVicențiu Ciorbaru2022-09-202-1/+3
|
* Column-level-denies DONEVicențiu Ciorbaru2022-09-2011-127/+824
|
* cleanup: update_hash variable namesVicențiu Ciorbaru2022-09-201-6/+5
|
* Add test case for stored procedure deniesVicențiu Ciorbaru2022-09-202-0/+303
|
* Fixup routine grants impacting check_grant_dbVicențiu Ciorbaru2022-09-205-23/+70
|
* cleanup: TODO removalsVicențiu Ciorbaru2022-09-201-17/+3
|
* TABLE level denies fixupVicențiu Ciorbaru2022-09-203-33/+160
| | | | check_grant_db now takes TABLE level denies into account.
* cleanup: sp_grant_privileges - More strightforward implementationVicențiu Ciorbaru2022-09-201-7/+3
|
* WIP Denies with stored procedures workingVicențiu Ciorbaru2022-09-201-4/+30
|
* cleanup: check_some_routine_access take in LEX_CSTRING& and Sp_handler&Vicențiu Ciorbaru2022-09-204-47/+54
| | | | | This is an intermediate cleanup commit, aimed at removing the need for strlens by passing in already computed LEX_CSTRINGS.
* cleanup: Fix translation for ILLEGAL_GRANT_FOR_TABLEVicențiu Ciorbaru2022-09-201-23/+19
| | | | Update string to match DENY clause too.
* Work on procedure grantsVicențiu Ciorbaru2022-09-202-35/+146
|
* Add indirection to clean up get_<...>_deny() functionsVicențiu Ciorbaru2022-09-202-76/+175
|
* More test casesVicențiu Ciorbaru2022-09-202-0/+47
|
* Table level denies, update callsites, fix bugsVicențiu Ciorbaru2022-09-203-22/+91
|
* fixup PRIV_TYPE operator overloadingVicențiu Ciorbaru2022-09-201-1/+17
|