From: Panu Matilainen Date: Thu, 17 Sep 2009 13:28:09 +0000 (+0300) Subject: Always open database files relative to database home X-Git-Tag: rpm-4.8.0-beta1~265 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c01766b3f60802f9d4b1aa56151f633323377915;p=platform%2Fupstream%2Frpm.git Always open database files relative to database home - This allows the db to move freely wherever (such as across chroots, RhBug:507309 and pile of related issues) .. and is even recommended by BDB documentation. Well duh. --- diff --git a/lib/backend/db3.c b/lib/backend/db3.c index 4dba73b..88af6a8 100644 --- a/lib/backend/db3.c +++ b/lib/backend/db3.c @@ -865,13 +865,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) } if (rc == 0) { - char * fullpath; - const char * dbpath; - fullpath = rpmGetPath(dbhome, "/", dbfile ? dbfile : "", NULL); - - dbpath = (!dbi->dbi_temporary) ? fullpath : dbfile; - - rc = (db->open)(db, txnid, dbpath, NULL, + rc = (db->open)(db, txnid, dbfile, NULL, dbi->dbi_type, oflags, dbi->dbi_perms); if (rc == 0 && dbi->dbi_type == DB_UNKNOWN) { @@ -880,7 +874,6 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) if (xx == 0) dbi->dbi_type = dbi_type; } - free(fullpath); } /* XXX return rc == errno without printing */