Skip to content

Commit

Permalink
Fixed CORE-3000: Error on delete user "ADMIN"
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed May 17, 2010
1 parent de4ca91 commit b03e2fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utilities/gsec/security.epp
Expand Up @@ -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)
{
Expand All @@ -64,7 +64,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

Expand All @@ -77,7 +77,7 @@ static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HA
}
}

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;
Expand Down

0 comments on commit b03e2fd

Please sign in to comment.