diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-10-29 10:58:29 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:43:41 +0100 |
commit | fa5c16944e4e92c5d63f4a341f74bb1602c7603c (patch) | |
tree | 0076b64c304f66fca503638120bac4fa25fa48e0 /source4/dsdb/samdb/ldb_modules | |
parent | 7c721a1f49d576e0a47c35e465206ade1c05d5a9 (diff) | |
download | samba-fa5c16944e4e92c5d63f4a341f74bb1602c7603c.tar.gz samba-fa5c16944e4e92c5d63f4a341f74bb1602c7603c.tar.bz2 samba-fa5c16944e4e92c5d63f4a341f74bb1602c7603c.zip |
r25748: Don't segfault if we don't have a schema yet.
Andrew Bartlett
(This used to be commit 388e15a4c1fab55d376be956c2a7168b946bc994)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/kludge_acl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 27c13ddf60..97130495a3 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -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); |