Details
-
Improvement
-
Status: Patch Available
-
Minor
-
Resolution: Unresolved
-
1.8.0
-
None
Description
The SentryStore.isMultiActionsSupported() function:
// Currently INSERT/SELECT/ALL are supported for Table and DB level privileges private boolean isMultiActionsSupported(TSentryPrivilege tPrivilege) { return tPrivilege.getDbName() != null; }
It is called in two places - in drop_privileges():
TSentryPrivilege tPrivilege = toSentryPrivilege(tAuthorizable); try { if (isMultiActionsSupported(tPrivilege)) { ...
The toSentryPrivilege() function:
private TSentryPrivilege toSentryPrivilege(TSentryAuthorizable tAuthorizable) throws SentryInvalidInputException { TSentryPrivilege tSentryPrivilege = new TSentryPrivilege(); tSentryPrivilege.setDbName(fromNULLCol(tAuthorizable.getDb())); tSentryPrivilege.setServerName(fromNULLCol(tAuthorizable.getServer())); tSentryPrivilege.setTableName(fromNULLCol(tAuthorizable.getTable())); tSentryPrivilege.setColumnName(fromNULLCol(tAuthorizable.getColumn())); tSentryPrivilege.setURI(fromNULLCol(tAuthorizable.getUri())); ...
So all fields are initialized to an emoty string which means that isMultiActionsSupported is always true.
The same is true for the second usage in renamePrivilege().
So currently the function is meaningless. So it should be either removed or changed to verify that dbName is non-empty and not "_NULL_".
Attachments
Attachments
Issue Links
- relates to
-
SENTRY-162 Cleanup DB store privilege metadata on Hive DDL statements
- Resolved
-
SENTRY-872 Uber jira for HMS HA + Sentry HA redesign
- Resolved
-
SENTRY-1541 toSentryPrivilege() should not copy fields that are not set in the source
- Resolved
-
SENTRY-1582 Comments to clarify the intent of string manipulation methods in SentryStore.java
- Resolved
- links to