The Samba-Bugzilla – Attachment 7883 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.6.next
0001-Fix-bug-9147-winbind-can-t-fetch-user-or-group-info-.patch (text/plain), 3.30 KB, created by
Jeremy Allison
on 2012-09-11 20:23:12 UTC
(
hide
)
Description:
git-am fix for 3.6.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2012-09-11 20:23:12 UTC
Size:
3.30 KB
patch
obsolete
>From 57fd87f07541f6e8f1dcb24a946c4802c947a75c Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 10 Sep 2012 15:17: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/configure-for-test | 4 ++++ > source3/lib/ldb_compat.c | 13 +++++++++---- > source4/lib/ldb/common/ldb_parse.c | 11 +++++++++-- > 3 files changed, 22 insertions(+), 6 deletions(-) > create mode 100755 source3/configure-for-test > >diff --git a/source3/configure-for-test b/source3/configure-for-test >new file mode 100755 >index 0000000..b35f4fe >--- /dev/null >+++ b/source3/configure-for-test >@@ -0,0 +1,4 @@ >+export SOCKET_WRAPPER_DIR=./sw >+export RUN_FROM_BUILD_FARM=yes >+./configure.developer --with-acl-support --with-aio-support --disable-pie --enable-socket-wrapper --enable-nss-wrapper --enable-pthreadpool "$@" >+#./configure.developer --with-acl-support --disable-pie --with-pam-support --with-dnsupdate-support --enable-socket-wrapper --enable-nss-wrapper --with-smbtorture4-path=/usr/local/samba4/bin/smbtorture --with-samba4srcdir=../../SAMBA_4_0/source >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
Actions:
View
Attachments on
bug 9147
:
7864
|
7865
|
7866
|
7874
|
7876
|
7879
|
7880
|
7881
|
7882
|
7883
|
7884
|
7885