summaryrefslogtreecommitdiff
path: root/lib/ntdb/ntdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ntdb/ntdb.c')
-rw-r--r--lib/ntdb/ntdb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ntdb/ntdb.c b/lib/ntdb/ntdb.c
index ddbf7d6e9e..6c75915899 100644
--- a/lib/ntdb/ntdb.c
+++ b/lib/ntdb/ntdb.c
@@ -234,7 +234,7 @@ out:
}
_PUBLIC_ enum NTDB_ERROR ntdb_fetch(struct ntdb_context *ntdb, NTDB_DATA key,
- NTDB_DATA *data)
+ NTDB_DATA *data)
{
ntdb_off_t off;
struct ntdb_used_record rec;
@@ -353,9 +353,15 @@ _PUBLIC_ void ntdb_add_flag(struct ntdb_context *ntdb, unsigned flag)
ntdb->flags |= NTDB_NOLOCK;
break;
case NTDB_NOMMAP:
+ if (ntdb->file->direct_count) {
+ ntdb_logerr(ntdb, NTDB_ERR_EINVAL, NTDB_LOG_USE_ERROR,
+ "ntdb_add_flag: Can't get NTDB_NOMMAP from"
+ " ntdb_parse_record!");
+ return;
+ }
ntdb->flags |= NTDB_NOMMAP;
#ifndef HAVE_INCOHERENT_MMAP
- ntdb_munmap(ntdb->file);
+ ntdb_munmap(ntdb);
#endif
break;
case NTDB_NOSYNC: