[MDEV-28455] CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS Created: 2022-05-02 Updated: 2022-10-25 Resolved: 2022-10-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Data Definition - Temporary |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.3.37, 10.4.27, 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2, 10.11.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Anel Husakovic |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
CREATE TEMPORARY TABLES privilege is supposed to allow all actions with temporary tables created by the session.
|
| Comments |
| Comment by Anel Husakovic [ 2022-05-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
The same is repeatable with older versions (not related only to
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-05-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Indeed, my bad. I've updated the info. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2022-05-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Patch for review https://github.com/MariaDB/server/commit/4c3cf5c4ce81ae80736f5f71f83dc4bdc7740dcd | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2022-05-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
anel I think you misunderstood elenst here when writing this patch. It looks like you made it such that CREATE TEMPORARY TABLE privilege is not enough to run SHOW INDEX in <temp-table>. This is in addition to how it is not enough to show content for SHOW COLUMNS in <temp-table>. The bug is reported as SHOW COLUMNS should only require CREATE TEMPORARY TABLE privilege for it to show temporary tables columns. Please adjust the patch accordingly, then send it again for review. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2022-06-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi elenst why would CREATE TEMPORARY TABLE privilege be enough to run show index or show columns on temporary tables ? | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-06-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
They are already very different in regard to grants. Unlike CREATE privilege on a base table, by definition, CREATE TEMPORARY TABLE privilege allows all actions on the temporary table. It is said in the KB and even better in MySQL manual (I don't believe there have been intentional changes comparing to MySQL in this regard yet):
Of course the list of examples is incomplete, "no further privilege checks" and "any operation" are the main part here. That said, I don't insist that it must be made sufficient for SHOW INDEX and SHOW COLUMNS, I leave it to ACL decision-makers. I do however believe that it must be the same for SHOW INDEX and SHOW COLUMNS – either allow both, or don't allow either. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2022-06-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks elenst,
So regarding the decision, I guess we should stick to MySQL documentation CREATE TEMPORARY TABLES (without SELECT_ACL, as in case for base tables) is enough to get SHOW COLUMNS what is actually the real bug, right serg ? | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Of course, CREATE TEMPORARY TABLES should be enough for SHOW COLUMNS to work on temporary tables. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2022-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, understood and implemented in PR #2180. Thanks. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2022-10-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
OK to push | ||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-10-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Where is a 10.5 version of this patch? |