svn commit: samba r6745 - in branches/SAMBA_4_0/source/libcli/ldap:
.
tridge at samba.org
tridge at samba.org
Thu May 12 08:26:27 GMT 2005
Author: tridge
Date: 2005-05-12 08:26:26 +0000 (Thu, 12 May 2005)
New Revision: 6745
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6745
Log:
- escape spaces in binary ldap blobs
- expose the ldap filter string parsing outside of ldap.c
Modified:
branches/SAMBA_4_0/source/libcli/ldap/ldap.c
branches/SAMBA_4_0/source/libcli/ldap/ldap.h
Changeset:
Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/ldap/ldap.c 2005-05-12 08:25:35 UTC (rev 6744)
+++ branches/SAMBA_4_0/source/libcli/ldap/ldap.c 2005-05-12 08:26:26 UTC (rev 6745)
@@ -150,7 +150,7 @@
char *ret;
int len = blob.length;
for (i=0;i<blob.length;i++) {
- if (!isprint(blob.data[i]) || blob.data[i] == '\\') {
+ if (!isprint(blob.data[i]) || strchr(" *()\\&|!", blob.data[i])) {
len += 2;
}
}
@@ -159,7 +159,7 @@
len = 0;
for (i=0;i<blob.length;i++) {
- if (!isprint(blob.data[i]) || blob.data[i] == '\\') {
+ if (!isprint(blob.data[i]) || strchr(" *()\\&|!", blob.data[i])) {
snprintf(ret+len, 4, "\\%02X", blob.data[i]);
len += 3;
} else {
@@ -318,7 +318,7 @@
<filter> ::= '(' <filtercomp> ')'
*/
static struct ldap_parse_tree *ldap_parse_filter(TALLOC_CTX *mem_ctx,
- const char **s)
+ const char **s)
{
char *l, *s2;
const char *p, *p2;
@@ -1335,3 +1335,13 @@
}
+
+/*
+ externally callable version of filter string parsing - used in the
+ cldap server
+*/
+struct ldap_parse_tree *ldap_parse_filter_string(TALLOC_CTX *mem_ctx,
+ const char *s)
+{
+ return ldap_parse_filter(mem_ctx, &s);
+}
Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/ldap/ldap.h 2005-05-12 08:25:35 UTC (rev 6744)
+++ branches/SAMBA_4_0/source/libcli/ldap/ldap.h 2005-05-12 08:26:26 UTC (rev 6745)
@@ -323,6 +323,8 @@
BOOL ldap_decode(struct asn1_data *data, struct ldap_message *msg);
BOOL ldap_parse_basic_url(TALLOC_CTX *mem_ctx, const char *url,
char **host, uint16_t *port, BOOL *ldaps);
+struct ldap_parse_tree *ldap_parse_filter_string(TALLOC_CTX *mem_ctx,
+ const char *s);
/* The following definitions come from libcli/ldap/ldap_client.c */
More information about the samba-cvs
mailing list