Informix Error -381
-381 Cannot grant to someone who has granted you the same privilege before.
The privilege you are trying to grant is one that was first granted to you WITH GRANT OPTION. The user who made that grant is among the list of users in this present statement. For security reasons, you may not do a reciprocal grant. Rewrite the statement leaving out the name of your original patron. To see a list of the users to whom you may not grant, query systabauth as follows:
SELECT grantor FROM systabauth WHERE grantee = USER
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-381 is a security guardrail against reciprocal grants: if user A granted a privilege to user B
WITH GRANT OPTION, user B can't turn around and grant that same privilege back to user A —
Informix blocks this circular pattern outright.
- A
GRANTstatement naming the same user who originally granted the current user this privilege — the direct, only cause. - A privilege-management script generating grants in bulk, unaware that one of the target users is actually the original grantor of that same privilege.
- Team/role rotation where privilege relationships have become tangled over time, making it easy to lose track of who originally granted what to whom.
Solutions / Resolution
- Rewrite the
GRANTstatement excluding the original grantor's name, per the official guidance — the privilege is already theirs; granting it back to them is meaningless and blocked. - Identify who granted you this privilege, to understand and avoid the restricted
relationship:
SELECT grantor FROM systabauth WHERE grantee = USER; - For bulk grant scripts, filter out any grantee who's also the current session's grantor for that same privilege before generating the statements.
Examples
Identifying the original grantor before granting
SELECT grantor FROM systabauth WHERE grantee = USER;
-- confirm the intended new grantee isn't in this list for the
-- specific privilege being granted
The disallowed reciprocal attempt
-- User A granted SELECT ON orders WITH GRANT OPTION to User B.
-- User B (now executing) attempts:
GRANT SELECT ON orders TO user_a;
-- -381: user_a already granted this privilege to the current user
Diagnostic Checks
- Query
systabauthfor the current user's grantors on the specific table/privilege in question. - Compare the intended grantee against that grantor list before issuing the
GRANT.
Related Errors / Related Topics
- -299 — "Cannot grant permission to self." A related self-referential
GRANTrestriction, in this case direct rather than a two-hop reciprocal relationship. - -298 — "Cannot grant permission to public with grant option." Another
GRANT-clause security restriction in the same privilege-management family.
Query systabauth to see who granted you the privilege in question before attempting to grant it
onward — reciprocal grants back to your own grantor are always blocked.