diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-07-03 14:33:23 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-07-03 15:28:57 +0200 |
commit | 326aac06f52a1e4d37449622e02d561ee12608cf (patch) | |
tree | 9e241449564ff5c8e51ba4a2940feecc726fc025 /source4 | |
parent | 02eab6602640e73f295a37019c0989dbd799229b (diff) | |
download | samba-326aac06f52a1e4d37449622e02d561ee12608cf.tar.gz samba-326aac06f52a1e4d37449622e02d561ee12608cf.tar.bz2 samba-326aac06f52a1e4d37449622e02d561ee12608cf.zip |
s4:schema_load LDB module - fix a segfault condition on schema refresh
The schema refresh operation itself starts requests from the top of the LDB
modules stack (see call "dsdb_schema_set_attributes" - search operations).
This doesn't work well when these do perform "dsdb_get_schema" calls. Since the
new schema isn't marked as "refreshed" atm (but in fact it still is - we didn't
terminate the reload/refresh yet) we could perform other calls to
"dsdb_schema_refresh" and run into serious trouble (segfault).
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/schema_load.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c index 9d9c9ebcd7..30aafdb65e 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_load.c +++ b/source4/dsdb/samdb/ldb_modules/schema_load.c @@ -224,6 +224,7 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_ goto failed; } + (*schema)->refresh_in_progress = true; (*schema)->refresh_fn = dsdb_schema_refresh; (*schema)->loaded_from_module = module; (*schema)->loaded_usn = current_usn; @@ -231,6 +232,10 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_ /* "dsdb_set_schema()" steals schema into the ldb_context */ ret = dsdb_set_schema(ldb, (*schema)); + if (*schema != NULL) { + (*schema)->refresh_in_progress = false; + } + if (ret != LDB_SUCCESS) { ldb_debug_set(ldb, LDB_DEBUG_FATAL, "schema_load_init: dsdb_set_schema() failed: %d:%s: %s", |