diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2017-08-28 19:17:24 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2017-10-26 10:40:47 +0300 |
commit | e7f67faeb7bdab4f0a4d93f7fda94c77899e1a76 (patch) | |
tree | 8359228f9747b226f133340f4e45352c143fdf08 | |
parent | 61ca9299669ef990bd835f78ae0c454445ca4de6 (diff) | |
download | rpm-e7f67faeb7bdab4f0a4d93f7fda94c77899e1a76.tar.gz |
Fallback to DB_PRIVATE on readonly DB_VERSION_MISMATCH too (RhBug:1465809)
All these years BDB has been relying on undefined behavior by storing
POSIX thread objects in its persistent environment files (for the long
story, see RhBug:1394862). As a side-effect of fixing it in BDB,
all sorts of creatures from dark corners are getting dragged into
the daylight: rawhide glibc gets updated a lot and we're getting
DB_VERSION_MISMATCH hits from rpm queries from package scriptlets
(told you so...), other tools not closing their database handles
when they should etc etc. This lets those cases continue "working"
to the extent they always did (ie unreliably) for now.
We should log some diagnostic message in this case, but coming up
with an understandable and reasonably short message for this mess
isn't that easy :)
(cherry picked from commit 2822ccbcdf3e898b960fafb23c4d571e26cef0a4)
-rw-r--r-- | lib/backend/db3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c index bbf10bc85..110c3087b 100644 --- a/lib/backend/db3.c +++ b/lib/backend/db3.c @@ -491,7 +491,7 @@ static int db_init(rpmdb rdb, const char * dbhome) if (rc == EINVAL && errno == rc) { eflags |= DB_PRIVATE; retry_open--; - } else if (rdonly && (rc == EACCES || rc == EROFS)) { + } else if (rdonly && (rc == EACCES || rc == EROFS || rc == DB_VERSION_MISMATCH)) { eflags |= DB_PRIVATE; retry_open--; } else { |