FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 217 forks source link

After granting system privilege USE_GBAK_UTILITY to a role, they still can't use gbak. #8298

Closed nickolasdeluca closed 3 weeks ago

nickolasdeluca commented 3 weeks ago

Firebird version: 4.0.4.3010.

Steps to reproduce: 1 - Created a user called backup. 2 - Created a role called BACKUP_ROLE using this command:

CREATE ROLE BACKUP_ROLE SET SYSTEM PRIVILEGES TO USE_GBAK_UTILITY;

3 - Granted the user backup the role of BACKUP_ROLE 4 - Tried to use gbak with the backup user

Got this message:

C:\Program Files\Firebird\Firebird_4_0>gbak.exe -b -user backup -password "MYPW" "MYDBPATH.FDB" "MYFBKPATH.FBK"
gbak: ERROR:Unable to perform operation
gbak: ERROR:    System privilege USE_GBAK_UTILITY is missing
gbak:Exiting before completion due to errors

The password, the database path and fbk path were redacted because of obvious reasons but they were correctly typed, I double checked

What am I supposed to do to allow my user backup to perform gbak backups and restores?

hvlad commented 3 weeks ago

Pass role to gbak, using ROLE switch

AlexPeshkoff commented 3 weeks ago

Also you may grant default role to user, it will be always active.

mrotteveel commented 3 weeks ago

To clarify the other two replies, unless the role is granted as a default role (a feature introduced in Firebird 4.0), a role is not automatically used; it only applies when you explicitly specify it when connecting.