diff options
author | Andrew Bartlett <abartlet@samba.org> | 2018-06-03 18:36:47 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-06-04 20:58:01 +0200 |
commit | 0f5d93a0baa7ef5fc0ef2404dc9a3cc3438d0b7f (patch) | |
tree | 78630cd3d068d3536d1d7433a040bb130d1d8408 /source4 | |
parent | 3c3b1bc64c642bbb28571621c8ee2e37d8d6556a (diff) | |
download | samba-0f5d93a0baa7ef5fc0ef2404dc9a3cc3438d0b7f.tar.gz |
dsdb: Honour LDB_FLG_NOSYNC for metadata.tdb
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13462
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun 4 20:58:01 CEST 2018 on sn-devel-144
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition_metadata.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition_metadata.c b/source4/dsdb/samdb/ldb_modules/partition_metadata.c index d44947232ae..197e7b092e0 100644 --- a/source4/dsdb/samdb/ldb_modules/partition_metadata.c +++ b/source4/dsdb/samdb/ldb_modules/partition_metadata.c @@ -187,7 +187,7 @@ static int partition_metadata_open(struct ldb_module *module, bool create) struct partition_private_data *data; struct loadparm_context *lp_ctx; char *filename, *dirname; - int open_flags; + int open_flags, tdb_flags, ldb_flags; struct stat statbuf; data = talloc_get_type_abort(ldb_module_get_private(module), @@ -237,9 +237,17 @@ static int partition_metadata_open(struct ldb_module *module, bool create) lp_ctx = talloc_get_type_abort(ldb_get_opaque(ldb, "loadparm"), struct loadparm_context); + tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT|TDB_SEQNUM); + + ldb_flags = ldb_module_flags(ldb); + + if (ldb_flags & LDB_FLG_NOSYNC) { + tdb_flags |= TDB_NOSYNC; + } + data->metadata->db = tdb_wrap_open( data->metadata, filename, 10, - lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT|TDB_SEQNUM), open_flags, 0660); + tdb_flags, open_flags, 0660); if (data->metadata->db == NULL) { talloc_free(tmp_ctx); if (create) { |