Issue Details (XML | Word | Printable)

Key: CORE-216
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Ann Harrison
Votes: 3
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

too many grants lose privileges

Created: 22/Dec/04 12:00 AM   Updated: 25/Apr/13 01:25 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Relate

SF_ID: 1089861


 Description  « Hide
SFID: 1089861#
Submitted By: awharrison

Issuing more than 2000 grants on any one object causes
an internal buffer flow in generating the access
control list that actually enforces the rights.

GRANT INSERT ON MY_TABLE TO TRIGGER T1;
GRANT INSERT ON MY_TABLE TO TRIGGER T2;
GRANT INSERT ON MY_TABLE TO TRIGGER T3;
...
GRANT INSERT ON MY_TABLE TO TRIGGER T2201;

All the grants are on the same object - in this case a
table and are given to differen entities, in this case,
2201 different triggers. Duplicate grants don't count
in the total.

In Firebird 1.0.x, some grants will not be recognized
at runtime. Grants to procedures disappear first, then
triggers, views, and finally users.

In Firebird 1.5.x, the acl is corrupted and no access
rights are recognized.

The problem normally arises because rights granted to
triggers, views, and procedures are not removed when
the triggers, views, or procedures are deleted.

The workaround is to manually remove obsolete records
from RDB$USER_PRIVILEGES until the total number of
grants on any one object is less than 1900. The actual
restriction is that the size of the ACL must be less
than 64Kb, where each ACL consists of the name of the
object to which the grant is made and a grant type,
grantee type, and some other bytes.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Krzysztof Adamski added a comment - 09/Mar/07 03:57 AM
I have similar problem, but in my case I need big amount of triggers and grants and I cannot workaround this limitation as suggested. Here is how I tested it, I had two tables:

create table TEST_TABLE_1 (ID TP2_INTEGER not null);
create table TEST_TABLE_2 (ID TP2_INTEGER not null);

and grant insert only on the first table:

grant insert on TEST_TABLE_1 to USER_1;

so, to insert to the second table I had created a trigger:

create trigger TEST_AFTER_INSERT_TRIGGER0
for TEST_TABLE_1 active after insert position 0
as
begin
   insert into TEST_TABLE_2 (ID) VALUES(NEW.ID);
end;

with grant:

grant insert on TEST_TABLE_2 to trigger TEST_AFTER_INSERT_TRIGGER0

I have tested it for growing amount of triggers, when 1861st trigger was created I lose proviliges on the second table, the error message was:

This user does not have privilege to perform this operation on this object.
-no permission for insert/write access to TABLE TEST_TABLE_2

Can anyboby tell me if there is any workaround for situation when I need big amount of grants on one table. I will appreciate if somebody can tell me if this limitation will be removed in the future versions of Firebird or it's just a feature which I have to accept.

Thank you,
Krzysztof Adamski

Alexander Peshkov added a comment - 11/Jul/08 09:52 AM
Fixed in HEAD.

Pavel Cisar added a comment - 25/Apr/13 01:25 PM
Test added.