From 2ed4ff13d509218785d9941dc17219958ab04223 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Nov 2004 02:15:43 +0000 Subject: r4010: fixed parsing of null attributes in the ldb ldif parser (This used to be commit b4fd76f78eadd8648ceed508766235e80702aa8f) --- source4/lib/ldb/common/ldb_ldif.c | 8 ++++++-- source4/lib/ldb/tests/init.ldif | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index bd99468182..94e15805a6 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -128,7 +128,11 @@ int ldb_should_b64_encode(const struct ldb_val *val) unsigned int i; uint8_t *p = val->data; - if (val->length == 0 || p[0] == ' ' || p[0] == ':') { + if (val->length == 0) { + return 0; + } + + if (p[0] == ' ' || p[0] == ':') { return 1; } @@ -377,7 +381,7 @@ static int next_attr(char **s, const char **attr, struct ldb_val *value) *attr = *s; - while (isspace(*p)) { + while (*p == ' ' || *p == '\t') { p++; } diff --git a/source4/lib/ldb/tests/init.ldif b/source4/lib/ldb/tests/init.ldif index a9ed4506fb..3b0eeffe2f 100644 --- a/source4/lib/ldb/tests/init.ldif +++ b/source4/lib/ldb/tests/init.ldif @@ -9,6 +9,7 @@ o: UM o: U-M o: U of M description: The University of Michigan at Ann Arbor +seeAlso: postaladdress: University of Michigan $ 535 W. William St. $ Ann Arbor, MI 481 09 $ US telephonenumber: +1 313 764-1817 -- cgit