mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 20:03:02 +01:00
Backported fix for CORE-3000: Error on delete user "ADMIN"
This commit is contained in:
parent
c62a17ca3c
commit
f453571799
@ -52,9 +52,9 @@ static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HA
|
||||
|
||||
Firebird::string sql;
|
||||
|
||||
sql.printf(io_user_data->admin ? "GRANT %s TO %s" : "REVOKE %s FROM %s",
|
||||
sql.printf(io_user_data->admin ? "GRANT %s TO \"%s\"" : "REVOKE %s FROM \"%s\"",
|
||||
"RDB$ADMIN", io_user_data->user_name);
|
||||
isc_dsql_execute_immediate(isc_status, &DB, &trans, sql.length(), sql.c_str(), 1, NULL);
|
||||
isc_dsql_execute_immediate(isc_status, &DB, &trans, sql.length(), sql.c_str(), SQL_DIALECT_V6, NULL);
|
||||
|
||||
if (isc_status[1] && io_user_data->admin == 0)
|
||||
{
|
||||
@ -63,7 +63,7 @@ static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HA
|
||||
WITH R.RDB$USER EQ io_user_data->user_name
|
||||
AND R.RDB$RELATION_NAME EQ 'RDB$ADMIN'
|
||||
AND R.RDB$PRIVILEGE EQ 'M'
|
||||
sql.printf("REVOKE RDB$ADMIN FROM %s GRANTED BY %s",
|
||||
sql.printf("REVOKE RDB$ADMIN FROM \"%s\" GRANTED BY \"%s\"",
|
||||
io_user_data->user_name, R.RDB$GRANTOR);
|
||||
END_FOR
|
||||
if (request)
|
||||
@ -74,7 +74,7 @@ static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HA
|
||||
return false;
|
||||
}
|
||||
}
|
||||
isc_dsql_execute_immediate(isc_status, &DB, &trans, sql.length(), sql.c_str(), 1, NULL);
|
||||
isc_dsql_execute_immediate(isc_status, &DB, &trans, sql.length(), sql.c_str(), SQL_DIALECT_V6, NULL);
|
||||
}
|
||||
|
||||
return isc_status[1] == 0;
|
||||
|
Loading…
Reference in New Issue
Block a user