瀏覽代碼

Ticket #324 - redux: Sync with group attribute containing () fails

https://fedorahosted.org/389/ticket/324
Resolves: Ticket #324
Bug Description: Sync with group attribute containing () fails
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Previous fix broke cases that did not need escaping.  Have
to use the return value of escape_filter_value() rather than use the buffer
passed to that function.  If the value doesn't need escaping, the original
value is returned, and the buffer is empty.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 13 年之前
父節點
當前提交
b4a09b6024
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      ldap/servers/plugins/replication/windows_protocol_util.c

+ 2 - 4
ldap/servers/plugins/replication/windows_protocol_util.c

@@ -2794,9 +2794,8 @@ find_entry_by_attr_value_remote(const char *attribute, const char *value, Slapi_
 
 	vallen = value ? strlen(value) : 0;
 	filter_escaped_value = slapi_ch_calloc(sizeof(char), vallen*3+1);
-	escape_filter_value(value, vallen, filter_escaped_value);
 	/* should not have to escape attribute names */
-	filter = PR_smprintf("(%s=%s)",attribute,filter_escaped_value);
+	filter = PR_smprintf("(%s=%s)",attribute,escape_filter_value(value, vallen, filter_escaped_value));
 	slapi_ch_free_string(&filter_escaped_value);
 	searchbase = slapi_sdn_get_dn(windows_private_get_windows_subtree(prp->agmt));
 	cres = windows_search_entry(prp->conn, (char*)searchbase, filter, &found_entry);
@@ -2930,9 +2929,8 @@ find_entry_by_attr_value(const char *attribute, const char *value, Slapi_Entry *
 
     vallen = value ? strlen(value) : 0;
     filter_escaped_value = slapi_ch_calloc(sizeof(char), vallen*3+1);
-    escape_filter_value(value, vallen, filter_escaped_value);
     /* should not have to escape attribute names */
-    query = slapi_ch_smprintf("(%s=%s)", attribute, filter_escaped_value);
+    query = slapi_ch_smprintf("(%s=%s)", attribute, escape_filter_value(value, vallen, filter_escaped_value));
     slapi_ch_free_string(&filter_escaped_value);
 
     if (query == NULL)