summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-13 20:27:33 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-13 20:27:33 +0300
commit9e71df3cf3cd2cf19d512d6d1c6fc849936e8c27 (patch)
tree6af612c6e24bef39bbad20b86b31c8948cc7cba2
parente5c3f4f4811bc52d15b0028f2872f5b1d191c419 (diff)
downloadapk-tools-9e71df3cf3cd2cf19d512d6d1c6fc849936e8c27.tar.gz
apk-tools-9e71df3cf3cd2cf19d512d6d1c6fc849936e8c27.tar.bz2
apk-tools-9e71df3cf3cd2cf19d512d6d1c6fc849936e8c27.tar.xz
apk-tools-9e71df3cf3cd2cf19d512d6d1c6fc849936e8c27.zip
db: cache needs to be on non-tmpfs
check device major if it's tmpfs and refuse to use cache if we've been fooled.
-rw-r--r--src/database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index df6e7f0..5673c3c 100644
--- a/src/database.c
+++ b/src/database.c
@@ -999,7 +999,7 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
db->permanent = 0;
if (fstatat64(db->root_fd, apk_linked_cache_dir, &st, 0) == 0 &&
- S_ISDIR(st.st_mode))
+ S_ISDIR(st.st_mode) && major(st.st_dev) != 0)
db->cache_dir = apk_linked_cache_dir;
if (dbopts->open_flags & APK_OPENF_WRITE) {