mdb_env_set_flags(): Reject CHANGELESS flags.

Reverts part of a2ac10107e.
MDB_ROBUST needed to be accepted, but that flag is gone.
vl32b
Hallvard Furuseth 10 years ago
parent 71741a6b08
commit 404697b369
  1. 1
      libraries/liblmdb/lmdb.h
  2. 2
      libraries/liblmdb/mdb.c

@ -736,7 +736,6 @@ void mdb_env_close(MDB_env *env);
* This may be used to set some flags in addition to those from
* #mdb_env_open(), or to unset these flags. If several threads
* change the flags at the same time, the result is undefined.
* Most flags cannot be changed after #mdb_env_open().
* @param[in] env An environment handle returned by #mdb_env_create()
* @param[in] flags The flags to change, bitwise OR'ed together
* @param[in] onoff A non-zero value sets the flags, zero clears them.

@ -9001,7 +9001,7 @@ mdb_env_copy(MDB_env *env, const char *path)
int ESECT
mdb_env_set_flags(MDB_env *env, unsigned int flag, int onoff)
{
if (flag & (env->me_map ? ~CHANGEABLE : ~(CHANGEABLE|CHANGELESS)))
if ((flag & CHANGEABLE) != flag)
return EINVAL;
if (onoff)
env->me_flags |= flag;

Loading…
Cancel
Save