summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-11-15 18:29:34 +0000
committerjbj <devnull@localhost>2002-11-15 18:29:34 +0000
commitfbd96006c48de87b8ae3194d10ffdf34bd3f9461 (patch)
tree85b8ef49c9d119ebf4dcd78fa7ae2424048ad703 /db
parent0288c9fcfa151f293ff96ffe601aa04e3cb28d33 (diff)
downloadlibrpm-tizen-fbd96006c48de87b8ae3194d10ffdf34bd3f9461.tar.gz
librpm-tizen-fbd96006c48de87b8ae3194d10ffdf34bd3f9461.tar.bz2
librpm-tizen-fbd96006c48de87b8ae3194d10ffdf34bd3f9461.zip
Apply patch.4.1.24.6:
6.Fix a bug where Berkeley DB could overwrite incorrectly formatted files rather than returning an error to the application during open. CVS patchset: 5869 CVS date: 2002/11/15 18:29:34
Diffstat (limited to 'db')
-rw-r--r--db/db/db_open.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/db/db/db_open.c b/db/db/db_open.c
index 66ea247cb..19413a5cf 100644
--- a/db/db/db_open.c
+++ b/db/db/db_open.c
@@ -8,7 +8,7 @@
#include "db_config.h"
#ifndef lint
-static const char revid[] = "Id: db_open.c,v 11.214 2002/08/07 16:16:47 bostic Exp ";
+static const char revid[] = "Id: db_open.c,v 11.215 2002/08/15 15:27:52 bostic Exp ";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
@@ -460,8 +460,7 @@ __db_chk_meta(dbenv, dbp, meta, do_metachk)
}
#ifdef HAVE_CRYPTO
- ret = __crypto_decrypt_meta(dbenv, dbp, (u_int8_t *)meta,
- DBMETASIZE, do_metachk);
+ ret = __crypto_decrypt_meta(dbenv, dbp, (u_int8_t *)meta, do_metachk);
#endif
return (ret);
}
@@ -537,11 +536,9 @@ swap_retry:
* and even a checksum error isn't a reason to panic the environment.
*/
if ((ret = __db_chk_meta(dbenv, dbp, meta, do_metachk)) != 0) {
- if (ret == -1) {
+ if (ret == -1)
__db_err(dbenv,
"%s: metadata page checksum error", name);
- ret = EINVAL;
- }
goto bad_format;
}
@@ -578,7 +575,7 @@ swap_retry:
bad_format:
__db_err(dbenv, "%s: unexpected file type or format", name);
- return (ret);
+ return (ret == 0 ? EINVAL : ret);
}
/*