From cfeac09fc0796ecf77593244e9e72c1521fd251c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Sep 2012 09:30:49 -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. --- lib/ldb/common/ldb_parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ldb/common/ldb_parse.c b/lib/ldb/common/ldb_parse.c index cfa29591940..f47ef433761 100644 --- a/lib/ldb/common/ldb_parse.c +++ b/lib/ldb/common/ldb_parse.c @@ -124,7 +124,8 @@ char *ldb_binary_encode(TALLOC_CTX *mem_ctx, struct ldb_val val) unsigned char *buf = val.data; for (i=0;i 0x7E || strchr(" *()\\&|!\"", buf[i])) { len += 2; } } @@ -133,7 +134,8 @@ char *ldb_binary_encode(TALLOC_CTX *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 { -- 2.11.4.GIT