Skip to content

Commit

Permalink
Backported CORE-6489: User without ALTER ANY ROLE privilege can use C…
Browse files Browse the repository at this point in the history
…OMMENT ON ROLE
  • Loading branch information
AlexPeshkoff committed Mar 12, 2021
1 parent f9c12bc commit 04598a6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/jrd/ini.epp
Expand Up @@ -445,6 +445,9 @@ void INI_format(const char* owner, const char* charset)
generator->gen_name, length, buffer);
}

add_security_to_sys_obj(tdbb, ownerName, obj_sql_role,
ADMIN_ROLE, length, buffer);

for (const IntlManager::CharSetDefinition* charset = IntlManager::defaultCharSets;
charset->name;
++charset)
Expand Down Expand Up @@ -1175,6 +1178,18 @@ static void add_security_to_sys_obj(thread_db* tdbb,
}
END_FOR
}
else if (obj_type == obj_sql_role)
{
FOR(REQUEST_HANDLE handle) R IN RDB$ROLES
WITH R.RDB$ROLE_NAME EQ obj_name.c_str()
{
MODIFY R USING
R.RDB$SECURITY_CLASS.NULL = FALSE;
PAD(security_class.c_str(), R.RDB$SECURITY_CLASS);
END_MODIFY
}
END_FOR
}
else if (obj_type == obj_database)
{
FOR(REQUEST_HANDLE handle) DB IN RDB$DATABASE
Expand Down

0 comments on commit 04598a6

Please sign in to comment.