diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/groupdb/mapping_ldb.c | 4 | ||||
-rw-r--r-- | source3/lib/ldb/include/ldb.h | 5 | ||||
-rw-r--r-- | source3/lib/ldb/ldb_tdb/ldb_tdb.c | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c index 8eafc2532b..4f3aa18534 100644 --- a/source3/groupdb/mapping_ldb.c +++ b/source3/groupdb/mapping_ldb.c @@ -67,6 +67,10 @@ static BOOL init_group_mapping(void) flags |= LDB_FLG_NOSYNC; } + if (!lp_use_mmap()) { + flags |= LDB_FLG_NOMMAP; + } + ret = ldb_connect(ldb, db_path, flags, NULL); if (ret != LDB_SUCCESS) { goto failed; diff --git a/source3/lib/ldb/include/ldb.h b/source3/lib/ldb/include/ldb.h index 44f9e5f3df..f96b90a1b2 100644 --- a/source3/lib/ldb/include/ldb.h +++ b/source3/lib/ldb/include/ldb.h @@ -233,6 +233,11 @@ struct ldb_utf8_fns { */ #define LDB_FLG_RECONNECT 4 +/** + Flag to tell backends not to use mmap +*/ +#define LDB_FLG_NOMMAP 8 + /* structures for ldb_parse_tree handling code */ diff --git a/source3/lib/ldb/ldb_tdb/ldb_tdb.c b/source3/lib/ldb/ldb_tdb/ldb_tdb.c index fead100f72..8b53982fdb 100644 --- a/source3/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source3/lib/ldb/ldb_tdb/ldb_tdb.c @@ -1029,6 +1029,11 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url, tdb_flags |= TDB_NOSYNC; } + /* and nommap option */ + if (flags & LDB_FLG_NOMMAP) { + tdb_flags |= TDB_NOMMAP; + } + if (flags & LDB_FLG_RDONLY) { open_flags = O_RDONLY; } else { |