From: Howard Chu Date: Tue, 18 Sep 2012 19:36:54 +0000 (-0700) Subject: ITS#7394 ignore WRITEMAP if RDONLY X-Git-Tag: OPENLDAP_REL_ENG_2_4_33~14^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d13ca0de4fccafa93cf97674f4b8539b8f00d3f3;p=openldap ITS#7394 ignore WRITEMAP if RDONLY --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 2c54cbd2e5..c0eb6252c2 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -3128,6 +3128,10 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode) if (rc) goto leave; + /* silently ignore WRITEMAP if we're only getting read access */ + if (F_ISSET(flags, MDB_RDONLY) && F_ISSET(flags, MDB_WRITEMAP)) + flags ^= MDB_WRITEMAP; + #ifdef _WIN32 if (F_ISSET(flags, MDB_RDONLY)) { oflags = GENERIC_READ;