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

Mahesh Hanumant Bandal commented on RANGER-3136:
------------------------------------------------

NPE issue was already fixed along with 
[RANGER-3078|https://issues.apache.org/jira/browse/RANGER-3078] and committed 
on master branch 
[https://github.com/apache/ranger/commit/208b6df0d42d63eb5834c889afb092b7a69146a4].

[~pradeep], Following is my observation :
[deletePoliciesProvidedInServiceMap()|https://github.com/apache/ranger/blob/4b9ab8a509f2e0d9e8e7dd210505fa7f342c2b44/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java#L2693]
 function eventually calls 
[getServicePolicies()|https://github.com/apache/ranger/blob/4ff1c7ea9984812ec2ea02910ff8bb9eb9003f9a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java#L2522]
 function in ServiceDBStore class which takes serchFilter object as an 
argument. After adding serviceName to serachFilter object at 
[ServiceREST.java#L2702|https://github.com/apache/ranger/blob/4b9ab8a509f2e0d9e8e7dd210505fa7f342c2b44/security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java#L2702]
 it will cause no-zone policies to undergo filtering process and code between 
[ServiceDBStore.java#L2536|https://github.com/apache/ranger/blob/4ff1c7ea9984812ec2ea02910ff8bb9eb9003f9a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java#L2536]
 and 
[ServiceDBStore.java#L2595|https://github.com/apache/ranger/blob/4ff1c7ea9984812ec2ea02910ff8bb9eb9003f9a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java#L2595]
 will execute. This code seems to be related to resource filter. As of now, it 
will filter out policies based on ServiceName and return list of RangerPolicy.

Currently there is no exception found with/without this patch during import 
policies with  "Override Policy" flag is checked. I am not sure about any other 
impact of introducing  "Service Name" to searchFilter in 
deletePoliciesProvidedInServiceMap() function.

[~rujia1019], can you please provide your analysis on the same? As NPE is 
already fixed and this patch introduces extra parameter to searchFilter.

> NullPointException found when import policies form web side and "isOverride" 
> is selected
> ----------------------------------------------------------------------------------------
>
>                 Key: RANGER-3136
>                 URL: https://issues.apache.org/jira/browse/RANGER-3136
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 2.1.0
>            Reporter: rujia
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: 
> 0001-NUllPointException-occur-when-import-polices-anf-isO.patch, 
> ServiceDBStore-L2536.png, image-2021-01-21-11-26-15-996.png, 
> image-2021-01-21-11-27-05-887.png
>
>
> i got NullPointException when i imported policies json file from rangeradmin 
> web, i selected "isOverride" flag, it is caused by RANGER-3064, serchFilter 
> will be null when do deletePolices. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to