ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spolavar...@apache.org
Subject ranger git commit: Revert "RANGER-2006: Fix problems detected by static code analysis in ranger usersync for ldap sync source - ranger-1.0 branch"
Date Wed, 14 Mar 2018 23:20:02 GMT
Repository: ranger
Updated Branches:
  refs/heads/ranger-1.0 3d341a4c2 -> c79aad436


Revert "RANGER-2006: Fix problems detected by static code analysis in ranger usersync for
ldap sync source - ranger-1.0 branch"

This reverts commit 024a3e392ba23b6d3a13f64b8159d54d062e4478.


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/c79aad43
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/c79aad43
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/c79aad43

Branch: refs/heads/ranger-1.0
Commit: c79aad4362b6f806da47462ec84e35108ba8eb1f
Parents: 3d341a4
Author: Sailaja Polavarapu <spolavarapu@hortonworks.com>
Authored: Wed Mar 14 13:24:39 2018 -0700
Committer: Sailaja Polavarapu <spolavarapu@hortonworks.com>
Committed: Wed Mar 14 13:24:39 2018 -0700

----------------------------------------------------------------------
 .../process/LdapDeltaUserGroupBuilder.java      |  2 +-
 .../process/LdapUserGroupBuilder.java           |  3 ++-
 .../config/UserGroupSyncConfig.java             | 27 --------------------
 3 files changed, 3 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/c79aad43/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapDeltaUserGroupBuilder.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapDeltaUserGroupBuilder.java
b/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapDeltaUserGroupBuilder.java
index c297f68..2852b32 100644
--- a/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapDeltaUserGroupBuilder.java
+++ b/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapDeltaUserGroupBuilder.java
@@ -901,7 +901,7 @@ public class LdapDeltaUserGroupBuilder extends AbstractUserGroupSource
{
 						.append(groupDN).append(")");
 			}
 			filter.append("))");
-			groupFilter += config.escapeSearchFilter(filter.toString());
+			groupFilter += filter;
 
 			LOG.info("extendedAllGroupsSearchFilter = " + groupFilter);
 			for (int ou=0; ou<groupSearchBase.length; ou++) {

http://git-wip-us.apache.org/repos/asf/ranger/blob/c79aad43/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
b/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
index 488aa76a..6b2648d 100644
--- a/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
+++ b/ugsync/src/main/java/org/apache/ranger/ldapusersync/process/LdapUserGroupBuilder.java
@@ -277,6 +277,7 @@ public class LdapUserGroupBuilder extends AbstractUserGroupSource {
 					+ ",  ldapReferral: " + ldapReferral
 					);
 		}
+
 	}
 
 	private void closeLdapContext() throws Throwable {
@@ -809,7 +810,7 @@ public class LdapUserGroupBuilder extends AbstractUserGroupSource {
 						.append(groupDN).append(")");
 			}
 			filter.append("))");
-            groupFilter += config.escapeSearchFilter(filter.toString());
+            groupFilter += filter;
 
 			LOG.debug("extendedAllGroupsSearchFilter = " + groupFilter);
 			for (String ou : groupSearchBase) {

http://git-wip-us.apache.org/repos/asf/ranger/blob/c79aad43/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
----------------------------------------------------------------------
diff --git a/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
b/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
index ed07696..45eeb1b 100644
--- a/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
+++ b/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
@@ -960,33 +960,6 @@ public class UserGroupSyncConfig  {
 		return deltaSyncEnabled;
 	}
 
-	public String escapeSearchFilter(String searchFilter) {
-		StringBuilder sb = new StringBuilder();
-		for (int i = 0; i < searchFilter.length(); i++) {
-			char ch = searchFilter.charAt(i);
-			switch (ch) {
-				case '\\':
-					sb.append("\\5c");
-					break;
-				case '*':
-					sb.append("\\2a");
-					break;
-				case '(':
-					sb.append("\\28");
-					break;
-				case ')':
-					sb.append("\\29");
-					break;
-				case '\u0000':
-					sb.append("\\00");
-					break;
-				default:
-					sb.append(ch);
-			}
-		}
-		return sb.toString();
-	}
-
 	/* Used only for unit testing */
 	public void setUserSearchFilter(String filter) {
 		prop.setProperty(LGSYNC_USER_SEARCH_FILTER, filter);


Mime
View raw message