[MDEV-14735] better matching order for grants Created: 2017-12-21  Updated: 2020-04-24  Resolved: 2019-06-17

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Fix Version/s: 10.4.6

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-19899 Multiple matching grants no longer st... Closed
Relates
relates to MDEV-8269 Correct fix for Bug #20181776 :- ACCE... Closed
relates to MDEV-14732 mysql.db privileges evaluated on orde... Closed

 Description   

grants are sorted by get_sort(), the idea is that more specific grants gets sorted (and matched) before less specific. The historical implementation is rather naïve and does not handle many cases correctly.

See linked bug reports for details.



 Comments   
Comment by Oleksandr Byelkin [ 2019-06-15 ]

OK to push, but please note (in the very beginning of description and well visible) that each d or h require 26 bit and u 1 bit of result. It is just for future use to avoid using "hdhd" by example of "huhu".

Maybe add counter of shifts in debug version and ASSERT that it will not move over sizeof(ulonglong) but it is if you like the idea.

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