Nadav Har'El created CASSANDRA-19005:
----------------------------------------
Summary: DROPing an overloaded UDF produces the wrong error
message if drop permissions are lacking
Key: CASSANDRA-19005
URL: https://issues.apache.org/jira/browse/CASSANDRA-19005
Project: Cassandra
Issue Type: Bug
Reporter: Nadav Har'El
When a user creates two user-defined functions with the same name but different
parameters, to later remove these functions with DROP FUNCTION, the user must
disambiguate which one to delete. For example, "DROP FUNCTION ks.fun(int,
int)". If the user tries just "DROP FUNCTION ks.fun", Cassandra will return an
InvalidRequest, complaining about "multiple functions" with the same name. So
far so good.
Now, if the user has (via GRANT) permissions to drop only one of these
functions and no permissions to drop the second, trying to do "DROP FUNCTION
ks.fun" should still return the good old InvalidRequest, because the request is
still just as ambiguous as it was when permissions weren't involved. But,
Cassandra instead notices that one of the variants, e.g., ks.fun(int, int),
doesn't have drop permissions, and returns an Unauthorized error (instead of
InvalidRequest), saying that "ks.fun(int, int)" doesn't have drop permissions.
This is true - but irrelevant - the user didn't ask to drop that specific
overload of the function. Moreover, it's misleading because it can lead the
user to GRANT these supposedly-missing permissions, but after granting them,
the DROP FUNCTION command still won't work, because it will still be ambiguous.
This is a minor error-path bug, but I noticed it while trying to exhaustively
look how permissions and functions interact in Cassandra.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]