1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r25748: Don't segfault if we don't have a schema yet.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2007-10-29 10:58:29 +01:00 committed by Stefan Metzmacher
parent 2ba99d58e9
commit 388e15a4c1

View File

@ -122,6 +122,12 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess
const struct dsdb_schema *schema = dsdb_get_schema(ldb);
const struct dsdb_class *class;
int i, j, ret;
/* If we don't have a schema yet, we can't do anything... */
if (schema == NULL) {
return LDB_SUCCESS;
}
/* Must remove any existing attribute, or else confusion reins */
ldb_msg_remove_attr(msg, attrName);
ret = ldb_msg_add_empty(msg, attrName, 0, &allowedAttributes);
@ -184,6 +190,12 @@ static int kludge_acl_childClasses(struct ldb_context *ldb, struct ldb_message *
const struct dsdb_schema *schema = dsdb_get_schema(ldb);
const struct dsdb_class *class;
int i, j, ret;
/* If we don't have a schema yet, we can't do anything... */
if (schema == NULL) {
return LDB_SUCCESS;
}
/* Must remove any existing attribute, or else confusion reins */
ldb_msg_remove_attr(msg, attrName);
ret = ldb_msg_add_empty(msg, attrName, 0, &allowedClasses);