You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Dapeng Sun (JIRA)" <ji...@apache.org> on 2016/04/06 12:16:25 UTC

[jira] [Comment Edited] (SENTRY-1184) NPE in HMSPaths#renameAuthzObject

    [ https://issues.apache.org/jira/browse/SENTRY-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228065#comment-15228065 ] 

Dapeng Sun edited comment on SENTRY-1184 at 4/6/16 10:15 AM:
-------------------------------------------------------------

Hi [~sravya], the {{java.lang.NullPointerException}} is occurred at [571 for (Entry e : eSet) {|https://github.com/cloudera/sentry/blob/cdh5-1.5.1_5.5.2/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java#L571].
I found {{deletePathsFromAuthzObject(oldName, pathElemsAsList);}} at line 560 and {{addPathsToAuthzObject(oldName, pathElemsAsList);}} at line 565 are both checked {{if (entries != null) {}}.

And according the code, when {{if (isUnderPrefix(newPath)}} at line 561 is true,{{addPathsToAuthzObject}} also didn't create new Entry set for the old table if entries is null. I think we may also need to ignore if the entries is null.

I will also upload a simple patch to fix it.


was (Author: dapengsun):
Hi [~sravya], the {{java.lang.NullPointerException}} is occurred at [571 for (Entry e : eSet) {|https://github.com/cloudera/sentry/blob/cdh5-1.5.1_5.5.2/sentry-hdfs/sentry-hdfs-common/src/main/java/org/apache/sentry/hdfs/HMSPaths.java#L571].
I found {{deletePathsFromAuthzObject(oldName, pathElemsAsList);}} at line 560 and {{addPathsToAuthzObject(oldName, pathElemsAsList);}} at line 565 are both checked {{if (entries != null) {}}.

And according the code, if  {{if (isUnderPrefix(newPath)}} at line 566 is true, the {{eSet}} shouldn't be null. I guess it may be happened at the rename operation of {{NotUnderPrefix path}}(external table?). And we may also have a check at the value of property {{sentry.authorization-provider.hdfs-path-prefixes}}.

I will also upload a simple patch to fix it.

> NPE in HMSPaths#renameAuthzObject
> ---------------------------------
>
>                 Key: SENTRY-1184
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1184
>             Project: Sentry
>          Issue Type: Bug
>            Reporter: Sravya Tirukkovalur
>            Assignee: Sravya Tirukkovalur
>
> java.lang.NullPointerException
> at org.apache.sentry.hdfs.HMSPaths.renameAuthzObject(HMSPaths.java:571)
> at org.apache.sentry.hdfs.UpdateableAuthzPaths.applyPartialUpdate(UpdateableAuthzPaths.java:106)
> at org.apache.sentry.hdfs.UpdateableAuthzPaths.updatePartial(UpdateableAuthzPaths.java:75)
> at org.apache.sentry.hdfs.SentryAuthorizationInfo.processUpdates(SentryAuthorizationInfo.java:174)
> at org.apache.sentry.hdfs.SentryAuthorizationInfo.update(SentryAuthorizationInfo.java:131)
> at org.apache.sentry.hdfs.SentryAuthorizationInfo.run(SentryAuthorizationInfo.java:193)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)