summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-18 09:49:28 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-18 09:49:28 +0300
commitf3cab403d4b3a4351037e6eab3832e92b02ae8fb (patch)
treeaa5999355a1a3ad48d2442df9b424e058ae10e4e /lib
parentc01766b3f60802f9d4b1aa56151f633323377915 (diff)
downloadlibrpm-tizen-f3cab403d4b3a4351037e6eab3832e92b02ae8fb.tar.gz
librpm-tizen-f3cab403d4b3a4351037e6eab3832e92b02ae8fb.tar.bz2
librpm-tizen-f3cab403d4b3a4351037e6eab3832e92b02ae8fb.zip
Sigh.. when not using environment, absolute paths are required
Diffstat (limited to 'lib')
-rw-r--r--lib/backend/db3.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 88af6a87f..92573a03d 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 */