[MDEV-26267] restore of dump with DEFINER = CURRENT_ROLE invalid Created: 2021-07-28  Updated: 2021-08-14

Status: Open
Project: MariaDB Server
Component/s: Authentication and Privilege System, Backup
Affects Version/s: 10.4.20
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Robert Dyas Assignee: Anel Husakovic
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Debian 10



 Description   

Say you are logged in with your role set to Admin (which is a valid role with most permissions) and you define a view, trigger, stored routine or schedule event with DEFINER = CURRENT_ROLE.

Now do a SQL dump of the database (not the server, just the one database), create a fresh install of Mariadb (so the Admin role does not yet exist), and try to import that dump. It will import successfuly without errors.

Now if you later create a role called Admin (with the same set of privilidges) and try to access the view you will get an error saying that it can't be accessed... i.e. DEFINER = Admin role and I've the the Admin role but I still can't access it.

NOTE that if I drop the database and import it again (now that the users and roles are defined prior to import) everything works correctly as it should.

I'm happy to provide additioal clarification as needed.



 Comments   
Comment by Robert Dyas [ 2021-08-11 ]

can this get assigned?

Generated at Thu Feb 08 09:44:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.