summaryrefslogtreecommitdiff
path: root/lib/backend
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-16 15:36:44 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-16 15:47:11 +0300
commitf3d2c4a9f92ffc399cf8ed5bebdac1531081ffd9 (patch)
treeb00bb2632655a7c4ce73214b408f35ac42736c5e /lib/backend
parentc339c3614484642b178716b0ccca88bb6ad3c20c (diff)
downloadlibrpm-tizen-f3d2c4a9f92ffc399cf8ed5bebdac1531081ffd9.tar.gz
librpm-tizen-f3d2c4a9f92ffc399cf8ed5bebdac1531081ffd9.tar.bz2
librpm-tizen-f3d2c4a9f92ffc399cf8ed5bebdac1531081ffd9.zip
Remove db environment on close on chrooted operations
- As we open the db from outside the chroot, the environment ends up containing paths that are not valid once we enter the chroot causing dumb issues like RhBug:513699 and RhBug:507309. - We'd be better off removing the environment always after access but limiting to chroots for now as the rpmdb open/close path is full of races when environment is not present. Chroots are somewhat special environemnts anyway and typically not concurrently accessed so it's less of an issue there. - While this still has all sorts of issues, it at least leaves the rpmdb in chroot in a functional state after initial install.
Diffstat (limited to 'lib/backend')
-rw-r--r--lib/backend/db3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 602ec1a18..a592fb6d4 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -59,7 +59,8 @@ static int db_fini(dbiIndex dbi, const char * dbhome)
xx = db_env_create(&dbenv, 0);
xx = cvtdberr(dbi, "db_env_create", xx, _debug);
xx = dbenv->remove(dbenv, dbhome, 0);
- xx = cvtdberr(dbi, "dbenv->remove", xx, _debug);
+ /* filter out EBUSY as it just means somebody else gets to clean it */
+ xx = cvtdberr(dbi, "dbenv->remove", xx, (xx == EBUSY ? 0 : _debug));
rpmlog(RPMLOG_DEBUG, "removed db environment %s\n", dbhome);