s4:lib/ldb: fix stupid <SID=...> dn parsing bugs
authorStefan Metzmacher <metze@samba.org>
Thu, 2 Oct 2008 09:23:21 +0000 (11:23 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 2 Oct 2008 09:41:10 +0000 (11:41 +0200)
metze

source4/lib/ldb/common/ldb_dn.c

index c0d36cfbf3e0c48239b123a8920fbd4d065cc068..e36aea4e697fd8b2dddf5bdfdcaad64d18aa7c2a 100644 (file)
@@ -91,7 +91,7 @@ struct ldb_dn *ldb_dn_from_ldb_val(void *mem_ctx, struct ldb_context *ldb, const
                         * exploded_dn control is used */
                        dn->special = true;
                        /* FIXME: add a GUID string to ldb_dn structure */
-               } else if (strdn->length >= 8 && strncasecmp((const char *)strdn->data, "<SID=", 8) == 0) {
+               } else if (strdn->length >= 5 && strncasecmp((const char *)strdn->data, "<SID=", 5) == 0) {
                        /* this is special DN returned when the
                         * exploded_dn control is used */
                        dn->special = true;
@@ -150,7 +150,7 @@ struct ldb_dn *ldb_dn_new_fmt(void *mem_ctx, struct ldb_context *ldb, const char
                 * exploded_dn control is used */
                dn->special = true;
                /* FIXME: add a GUID string to ldb_dn structure */
-       } else if (strncasecmp(strdn, "<SID=", 8) == 0) {
+       } else if (strncasecmp(strdn, "<SID=", 5) == 0) {
                /* this is special DN returned when the
                 * exploded_dn control is used */
                dn->special = true;