mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#7598 mdb_dbi_open(named DB): Check mainDB flags.
Reject attempts to open named databases if the main database has flag MDB_DUPSORT or MDB_INTEGERKEY. DUPSORT would require an xcursor for the DB, INTEGERKEY would expect the DB name to be a binary integer.
This commit is contained in:
parent
a2ce25482a
commit
1b6d7ee7e1
@ -7226,6 +7226,10 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db
|
|||||||
if (!unused && txn->mt_numdbs >= txn->mt_env->me_maxdbs)
|
if (!unused && txn->mt_numdbs >= txn->mt_env->me_maxdbs)
|
||||||
return MDB_DBS_FULL;
|
return MDB_DBS_FULL;
|
||||||
|
|
||||||
|
/* Cannot mix named databases with some mainDB flags */
|
||||||
|
if (txn->mt_dbs[MAIN_DBI].md_flags & (MDB_DUPSORT|MDB_INTEGERKEY))
|
||||||
|
return (flags & MDB_CREATE) ? MDB_INCOMPATIBLE : MDB_NOTFOUND;
|
||||||
|
|
||||||
/* Find the DB info */
|
/* Find the DB info */
|
||||||
dbflag = DB_NEW|DB_VALID;
|
dbflag = DB_NEW|DB_VALID;
|
||||||
exact = 0;
|
exact = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user