The Samba-Bugzilla – Attachment 7885 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]
git-am fix for 3.5.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:32:40 UTC
(
hide
)
Description:
git-am fix for 3.5.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2012-09-11 20:32:40 UTC
Size:
2.59 KB
patch
obsolete
>From 3f12143cea343400c3de5f433295dd3241170c9a Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >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 | 11 +++++++++-- > source4/lib/ldb/common/ldb_parse.c | 11 +++++++++-- > 2 files changed, 18 insertions(+), 4 deletions(-) > >diff --git a/source3/lib/ldb/common/ldb_parse.c b/source3/lib/ldb/common/ldb_parse.c >index bcc92c5..1412d57 100644 >--- a/source3/lib/ldb/common/ldb_parse.c >+++ b/source3/lib/ldb/common/ldb_parse.c >@@ -92,6 +92,13 @@ 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 >@@ -105,7 +112,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; > } > } >@@ -114,7 +121,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 ba16b57..22a25c9 100644 >--- a/source4/lib/ldb/common/ldb_parse.c >+++ b/source4/lib/ldb/common/ldb_parse.c >@@ -89,6 +89,13 @@ 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 >@@ -102,7 +109,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; > } > } >@@ -111,7 +118,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 { >-- >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