summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/objectclass.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-05 08:53:11 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-05 08:56:06 +1000
commit43aa546ecc3f05845793b1a7354685d50a77c170 (patch)
tree282c318ee900ba81ee91fe95328871d175b24cd6 /source4/dsdb/samdb/ldb_modules/objectclass.c
parent25a65d604676b25f97ca427b805d151c1a40a07e (diff)
downloadsamba-43aa546ecc3f05845793b1a7354685d50a77c170.tar.gz
samba-43aa546ecc3f05845793b1a7354685d50a77c170.tar.bz2
samba-43aa546ecc3f05845793b1a7354685d50a77c170.zip
s4:dsdb Don't cast an ldb_val into a const char * for schema lookups
This removes a number of cases where we did a cast into a const char * of an ldb_val. While convention is to alway have an extra \0 at data[length] in the ldb_val, this is not required, and does not occour at least on build farm host 'svart'. Andrew Bartlett
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectclass.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectclass.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 7883bccfe7..4f013709b2 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -134,9 +134,10 @@ static int objectclass_sort(struct ldb_module *module,
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
- current->objectclass = dsdb_class_by_lDAPDisplayName(schema, (const char *)objectclass_element->values[i].data);
+ current->objectclass = dsdb_class_by_lDAPDisplayName_ldb_val(schema, &objectclass_element->values[i]);
if (!current->objectclass) {
- ldb_asprintf_errstring(ldb, "objectclass %s is not a valid objectClass in schema", (const char *)objectclass_element->values[i].data);
+ ldb_asprintf_errstring(ldb, "objectclass %.*s is not a valid objectClass in schema",
+ (int)objectclass_element->values[i].length, (const char *)objectclass_element->values[i].data);
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}