spolavarpau1 commented on code in PR #1162:
URL: https://github.com/apache/ranger/pull/1162#discussion_r3973874312


##########
ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java:
##########
@@ -777,6 +782,10 @@ private void computeGroupDelta(Map<String, Map<String, 
String>> sourceGroups) {
                         deltaGroups.put(groupName, curGroup);
                         noOfModifiedGroups++;
                         groupNameMap.put(groupDN, groupName);
+
+                        if (isDnValidationEnabled) {

Review Comment:
   I think you should check allowSyncSourceOverwrite instead of 
isDnValidationEnabled isn't it?



##########
ugsync/src/main/java/org/apache/ranger/unixusersync/process/PolicyMgrUserGroupBuilder.java:
##########
@@ -754,18 +756,21 @@ private void computeGroupDelta(Map<String, Map<String, 
String>> sourceGroups) {
                     deltaGroups.put(groupName, curGroup);
                     noOfModifiedGroups++;
                     groupNameMap.put(groupDN, groupName);
-                } else {
-                    if (MapUtils.isNotEmpty(curGroupAttrs) && 
!StringUtils.equalsIgnoreCase(groupDN, curGroupDN)) { // skip update
-                        LOG.debug("[{}]: SyncSource update skipped, current 
group DN = {} new user DN  = {}", groupName, curGroupDN, groupDN);
 
-                        if (StringUtils.equalsIgnoreCase(curGroupAttrsStr, 
newGroupAttrsStr)) {
-                            groupNameMap.put(groupDN, groupName);
-                        }
+                    if (isDnValidationEnabled) {
+                        groupNameMap.remove(curGroupDN);

Review Comment:
   I don't think we need to add this check for the existing case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to