summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-10-10 11:38:07 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-10-10 11:38:52 +0300
commit7ee47c808bdda24a658b325f229a2a8b84fe3790 (patch)
tree7efb41abf732bfb36a7c97835db54230d10dd565
parent71c6f88bc0befdccd4b5dd40e32ca6dcc94f9df8 (diff)
downloadapk-tools-7ee47c808bdda24a658b325f229a2a8b84fe3790.tar.gz
apk-tools-7ee47c808bdda24a658b325f229a2a8b84fe3790.tar.bz2
apk-tools-7ee47c808bdda24a658b325f229a2a8b84fe3790.tar.xz
apk-tools-7ee47c808bdda24a658b325f229a2a8b84fe3790.zip
db: handle default root correctly for /proc
dbopts->root may be null; use db->root instead fixes #7162
-rw-r--r--src/database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index 12f1d16..a35bab2 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1581,7 +1581,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
apk_blob_to_file(db->root_fd, apk_arch_file, *db->arch, APK_BTF_ADD_EOL);
/* mount /proc */
- if (asprintf(&db->root_proc_dir, "%s/proc", dbopts->root) == -1)
+ if (asprintf(&db->root_proc_dir, "%s/proc", db->root) == -1)
goto ret_errno;
if (statfs(db->root_proc_dir, &stfs) != 0) {
if (errno == ENOENT) mkdir(db->root_proc_dir, 0555);