mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
ITS#7878 Replace uint32_t with unsigned in back-mdb
init.c: align mi_dbenv_flags and flags with mdb_dbi_open, which declares flags as unsigned int. search.c: align mi_rtxn_size with ARG_UINT; adjust ww_ctx.nentries to silence a warning about signed/unsigned comparison. config.c: parse checkpoint config more carefully. Reject negative or unreasonably large values for kbytes and minutes. Ensure both values are parsed successfully before making any changes. Fixes a compilation failure under MinGW, where stdint.h types are not implicitly pulled in by other headers.
This commit is contained in:
parent
feb6f21d2e
commit
38f9dd2fb8
4 changed files with 12 additions and 12 deletions
|
|
@ -68,7 +68,7 @@ struct mdb_info {
|
|||
|
||||
/* DB_ENV parameters */
|
||||
char *mi_dbenv_home;
|
||||
uint32_t mi_dbenv_flags;
|
||||
unsigned mi_dbenv_flags;
|
||||
int mi_dbenv_mode;
|
||||
|
||||
size_t mi_mapsize;
|
||||
|
|
@ -82,10 +82,10 @@ struct mdb_info {
|
|||
int mi_search_stack_depth;
|
||||
int mi_readers;
|
||||
|
||||
uint32_t mi_rtxn_size;
|
||||
unsigned mi_rtxn_size;
|
||||
int mi_txn_cp;
|
||||
uint32_t mi_txn_cp_min;
|
||||
uint32_t mi_txn_cp_kbyte;
|
||||
unsigned mi_txn_cp_min;
|
||||
unsigned mi_txn_cp_kbyte;
|
||||
|
||||
struct re_s *mi_txn_cp_task;
|
||||
struct re_s *mi_index_task;
|
||||
|
|
|
|||
|
|
@ -644,22 +644,22 @@ mdb_cf_gen( ConfigArgs *c )
|
|||
}
|
||||
break;
|
||||
case MDB_CHKPT: {
|
||||
long l;
|
||||
mdb->mi_txn_cp = 1;
|
||||
if ( lutil_atolx( &l, c->argv[1], 0 ) != 0 ) {
|
||||
unsigned cp_kbyte, cp_min;
|
||||
if ( lutil_atoux( &cp_kbyte, c->argv[1], 0 ) != 0 ) {
|
||||
fprintf( stderr, "%s: "
|
||||
"invalid kbyte \"%s\" in \"checkpoint\".\n",
|
||||
c->log, c->argv[1] );
|
||||
return 1;
|
||||
}
|
||||
mdb->mi_txn_cp_kbyte = l;
|
||||
if ( lutil_atolx( &l, c->argv[2], 0 ) != 0 ) {
|
||||
if ( lutil_atoux( &cp_min, c->argv[2], 0 ) != 0 ) {
|
||||
fprintf( stderr, "%s: "
|
||||
"invalid minutes \"%s\" in \"checkpoint\".\n",
|
||||
c->log, c->argv[2] );
|
||||
return 1;
|
||||
}
|
||||
mdb->mi_txn_cp_min = l;
|
||||
mdb->mi_txn_cp = 1;
|
||||
mdb->mi_txn_cp_kbyte = cp_kbyte;
|
||||
mdb->mi_txn_cp_min = cp_min;
|
||||
/* If we're in server mode and time-based checkpointing is enabled,
|
||||
* submit a task to perform periodic checkpoints.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ mdb_db_open( BackendDB *be, ConfigReply *cr )
|
|||
int rc, i;
|
||||
struct mdb_info *mdb = (struct mdb_info *) be->be_private;
|
||||
struct stat stat1;
|
||||
uint32_t flags;
|
||||
unsigned flags;
|
||||
char *dbhome;
|
||||
MDB_txn *txn;
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ typedef struct ww_ctx {
|
|||
ID key;
|
||||
MDB_val data;
|
||||
int flag;
|
||||
int nentries;
|
||||
unsigned nentries;
|
||||
} ww_ctx;
|
||||
|
||||
/* ITS#7904 if we get blocked while writing results to client,
|
||||
|
|
|
|||
Loading…
Reference in a new issue