From f3cab403d4b3a4351037e6eab3832e92b02ae8fb Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 18 Sep 2009 09:49:28 +0300 Subject: [PATCH] Sigh.. when not using environment, absolute paths are required --- lib/backend/db3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/backend/db3.c b/lib/backend/db3.c index 88af6a8..92573a0 100644 --- a/lib/backend/db3.c +++ b/lib/backend/db3.c @@ -865,7 +865,12 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) } if (rc == 0) { - rc = (db->open)(db, txnid, dbfile, NULL, + char *fullpath = NULL; + /* When not in environment, absolute path is needed */ + if (!dbi->dbi_use_dbenv && !dbi->dbi_temporary) { + fullpath = rpmGetPath(dbhome, "/", dbfile, NULL); + } + rc = (db->open)(db, txnid, fullpath ? fullpath : dbfile, NULL, dbi->dbi_type, oflags, dbi->dbi_perms); if (rc == 0 && dbi->dbi_type == DB_UNKNOWN) { @@ -874,6 +879,7 @@ 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 */ -- 2.7.4