From e7f67faeb7bdab4f0a4d93f7fda94c77899e1a76 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 28 Aug 2017 19:17:24 +0300 Subject: 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) --- lib/backend/db3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- cgit v1.2.1