The Samba-Bugzilla – Attachment 7884 Details for
Bug 9147
winbind can't fetch user or group info from AD via LDAP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
(correct) git-am fix for 3.6.next.
0001-Fix-bug-9147-winbind-can-t-fetch-user-or-group-info-.patch (text/plain), 2.59 KB, created by
Jeremy Allison
on 2012-09-11 20:26:36 UTC
(
hide
)
Description:
(correct) git-am fix for 3.6.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2012-09-11 20:26:36 UTC
Size:
2.59 KB
patch
obsolete
>From a3c3563ef9e9799b2063a97ba4dd6bc677027529 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Tue, 11 Sep 2012 13:25:14 -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_compat.c | 13 +++++++++---- > source4/lib/ldb/common/ldb_parse.c | 11 +++++++++-- > 2 files changed, 18 insertions(+), 6 deletions(-) > >diff --git a/source3/lib/ldb_compat.c b/source3/lib/ldb_compat.c >index 36a29e6..494d381 100644 >--- a/source3/lib/ldb_compat.c >+++ b/source3/lib/ldb_compat.c >@@ -84,8 +84,13 @@ static struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str) > return ret; > } > >- >- >+static bool need_encode(unsigned char cval) >+{ >+ if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) { >+ return true; >+ } >+ return false; >+} > > /* > encode a blob as a RFC2254 binary string, escaping any >@@ -99,7 +104,7 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) > unsigned char *buf = val.data; > > for (i=0;i<val.length;i++) { >- if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) { >+ if (need_encode(buf[i])) { > len += 2; > } > } >@@ -108,7 +113,7 @@ char *ldb_binary_encode(void *mem_ctx, struct ldb_val val) > > len = 0; > for (i=0;i<val.length;i++) { >- if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) { >+ if (need_encode(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 b4eabf8..1ea425a 100644 >--- a/source4/lib/ldb/common/ldb_parse.c >+++ b/source4/lib/ldb/common/ldb_parse.c >@@ -111,6 +111,13 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *mem_ctx, const char *str) > return ret; > } > >+static bool need_encode(unsigned char cval) >+{ >+ if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) { >+ return true; >+ } >+ return false; >+} > > /* > encode a blob as a RFC2254 binary string, escaping any >@@ -124,7 +131,7 @@ char *ldb_binary_encode(TALLOC_CTX *mem_ctx, struct ldb_val val) > unsigned char *buf = val.data; > > for (i=0;i<val.length;i++) { >- if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) { >+ if (need_encode(buf[i])) { > len += 2; > } > } >@@ -133,7 +140,7 @@ char *ldb_binary_encode(TALLOC_CTX *mem_ctx, struct ldb_val val) > > len = 0; > for (i=0;i<val.length;i++) { >- if (!isprint(buf[i]) || strchr(" *()\\&|!\"", buf[i])) { >+ if (need_encode(buf[i])) { > snprintf(ret+len, 4, "\\%02X", buf[i]); > len += 3; > } else { >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
obnox
:
review+
Actions:
View
Attachments on
bug 9147
:
7864
|
7865
|
7866
|
7874
|
7876
|
7879
|
7880
|
7881
|
7882
|
7883
| 7884 |
7885