summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-08-13 16:39:14 +0000
committerjbj <devnull@localhost>2001-08-13 16:39:14 +0000
commita36acaf3b8f2a1417c65ab9f68e3a868045a12d4 (patch)
treeb676107ed7f4e04d73961d027728f52dbc1d367f /rpmdb
parent8f2315934d44214c4c446d077c8122c4dea6381f (diff)
downloadlibrpm-tizen-a36acaf3b8f2a1417c65ab9f68e3a868045a12d4.tar.gz
librpm-tizen-a36acaf3b8f2a1417c65ab9f68e3a868045a12d4.tar.bz2
librpm-tizen-a36acaf3b8f2a1417c65ab9f68e3a868045a12d4.zip
- fix: segfault on headerFree given malicious data.
- fix: don't verify hash page nelem. - better error messages for verification failures. - include directory /usr/lib/rpm in rpm package. CVS patchset: 5013 CVS date: 2001/08/13 16:39:14
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/db3.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 1ba3da9e7..9f5e58915 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -606,7 +606,16 @@ static int db3stat(dbiIndex dbi, unsigned int flags)
return rc;
}
-/** @todo Add/use per-rpmdb verify_on_close. */
+/*
+ * XXX Doing a db->del followed by a db->put for the same record
+ * causes the nelem/page count to go awry, causing db->verify failure.
+ * Turn off the message for now.
+ */
+
+/*@-redecl -exportheadervar@*/
+extern int db_hash_nelem_debug;
+/*@=redecl =exportheadervar@*/
+
static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags)
/*@modifies dbi, fileSystem @*/
{
@@ -677,6 +686,19 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags)
rc = cvtdberr(dbi, "db_env_create", rc, _debug);
if (rc || dbenv == NULL) goto exit;
+ dbenv->set_errcall(dbenv, rpmdb->db_errcall);
+ dbenv->set_errfile(dbenv, rpmdb->db_errfile);
+ dbenv->set_errpfx(dbenv, rpmdb->db_errpfx);
+ /* dbenv->set_paniccall(???) */
+ (void) dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT,
+ (dbi->dbi_verbose & DB_VERB_CHKPOINT));
+ (void) dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK,
+ (dbi->dbi_verbose & DB_VERB_DEADLOCK));
+ (void) dbenv->set_verbose(dbenv, DB_VERB_RECOVERY,
+ (dbi->dbi_verbose & DB_VERB_RECOVERY));
+ (void) dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR,
+ (dbi->dbi_verbose & DB_VERB_WAITSFOR));
+
if (dbi->dbi_tmpdir) {
const char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
rc = dbenv->set_tmp_dir(dbenv, tmpdir);