From 963bcbf3fa33ae5e8759c509bfabe5534bf5f79d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Sep 2012 16:07:37 -0700 Subject: [PATCH] Fix bug #9147 - winbind can't fetch user or group info from AD via LDAP Don't use "isprint" in ldb_binary_encode(). This is locale specific. Restrict to ASCII only, hex encode everything else. --- source3/lib/ldb/common/ldb_parse.c | 6 ++++-- source4/lib/ldb/common/ldb_parse.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source3/lib/ldb/common/ldb_parse.c b/source3/lib/ldb/common/ldb_parse.c index bcc92c5..fe9416b 100644 --- a/source3/lib/ldb/common/ldb_parse.c +++ b/source3/lib/ldb/common/ldb_parse.c @@ -105,7 +105,8 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) unsigned char *buf = val.data; for (i=0;i 0x7E || strchr(" *()\\&|!\"", buf[i])) { len += 2; } } @@ -114,7 +115,8 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) len = 0; for (i=0;i 0x7E || strchr(" *()\\&|!\"", buf[i])) { snprintf(ret+len, 4, "\\%02X", buf[i]); len += 3; } else { diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index ba16b57..867f00f 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -102,7 +102,8 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) unsigned char *buf = val.data; for (i=0;i 0x7E || strchr(" *()\\&|!\"", buf[i])) { len += 2; } } @@ -111,7 +112,8 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) len = 0; for (i=0;i 0x7E || strchr(" *()\\&|!\"", buf[i])) { snprintf(ret+len, 4, "\\%02X", buf[i]); len += 3; } else { -- 1.7.7.3