Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 318048 Details for
Bug 464752
RFE: Proposed patch to automates removal of a Berkeley DB dbenv when DB_VERSION_MISMATCH or EINVAL is returned
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
rpm-4.4.2-db3-mismatch.patch
rpm-4.4.2-db3-mismatch.patch (text/plain), 1.96 KB, created by
Elia Pinto
on 2008-09-30 08:47:14 UTC
(
hide
)
Description:
rpm-4.4.2-db3-mismatch.patch
Filename:
MIME Type:
Creator:
Elia Pinto
Created:
2008-09-30 08:47:14 UTC
Size:
1.96 KB
patch
obsolete
>--- rpm-4.4.2/rpmdb/db3.c.mismatch 2008-09-29 12:25:56.000000000 -0400 >+++ rpm-4.4.2/rpmdb/db3.c 2008-09-29 12:30:02.000000000 -0400 >@@ -281,6 +281,7 @@ static int db_init(dbiIndex dbi, const c > DB_ENV *dbenv = NULL; > int eflags; > int rc; >+ int xx; > > if (dbenvp == NULL) > return 1; >@@ -434,7 +435,12 @@ static int db_init(dbiIndex dbi, const c > #else > rc = dbenv->open(dbenv, dbhome, NULL, eflags, dbi->dbi_perms); > #endif >- rc = cvtdberr(dbi, "dbenv->open", rc, _debug); >+ xx = _debug; >+#if defined(DB_VERSION_MISMATCH) >+ if (rc == DB_VERSION_MISMATCH) xx = 0; >+#endif >+ if (rc == EINVAL) xx = 0; >+ rc = cvtdberr(dbi, "dbenv->open", rc, xx); > if (rc) > goto errxit; > >@@ -446,7 +452,6 @@ static int db_init(dbiIndex dbi, const c > > errxit: > if (dbenv) { >- int xx; > xx = dbenv->close(dbenv, 0); > xx = cvtdberr(dbi, "dbenv->close", xx, _debug); > } >@@ -1122,7 +1127,37 @@ static int db3open(rpmdb rpmdb, rpmTag r > /*@-mods@*/ > if (rpmdb->db_dbenv == NULL) { > rc = db_init(dbi, dbhome, dbfile, dbsubfile, &dbenv); >- if (rc == 0) { >+ switch (rc) { >+ default: >+ break; >+#if defined(DB_VERSION_MISMATCH) /* Nuke __db* files and retry open once. */ >+ case DB_VERSION_MISMATCH: >+#endif >+ case EINVAL: >+ if (getuid() != 0) >+ break; >+ { char * filename = alloca(BUFSIZ); >+ struct stat st; >+ int i; >+ >+ for (i = 0; i < 16; i++) { >+ sprintf(filename, "%s/__db.%03d", dbhome, i); >+ (void)rpmCleanPath(filename); >+ if (Stat(filename, &st) >+ && (errno == ENOENT || errno == EINVAL)) >+ continue; >+ xx = Unlink(filename); >+ } >+ } >+ dbi->dbi_oeflags |= DB_CREATE; >+ dbi->dbi_eflags &= ~DB_JOINENV; >+ rc = db_init(dbi, dbhome, dbfile, dbsubfile, &dbenv); >+ /* XXX db_init EINVAL was masked. */ >+ rc = cvtdberr(dbi, "dbenv->open", rc, _debug); >+ if (rc) >+ break; >+ /*@fallthrough@*/ >+ case 0: > rpmdb->db_dbenv = dbenv; > rpmdb->db_opens = 1; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 464752
: 318048