summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-10-26 09:46:09 +0200
committerTimo Teras <timo.teras@iki.fi>2009-10-26 09:46:09 +0200
commita7360395ea963334e80fb49d3fc36789d6f40685 (patch)
treeac8d1de4c408d5feccb6d500895c1679f5ec7776 /src/io.c
parentcc4644a54e4bb92507f957832647d91f7f91c21b (diff)
downloadapk-tools-a7360395ea963334e80fb49d3fc36789d6f40685.tar.gz
apk-tools-a7360395ea963334e80fb49d3fc36789d6f40685.tar.bz2
apk-tools-a7360395ea963334e80fb49d3fc36789d6f40685.tar.xz
apk-tools-a7360395ea963334e80fb49d3fc36789d6f40685.zip
db: fix migration and pruning of symlinks to dirs
the old code treated a symlink to directory as file; it tried to calculate regular has of it. fix this by: 1) using no follow on migration and pruning stats, and 2) the helper function to check if it's point to directory and not calculate hash in that case. fixes #188.
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io.c b/src/io.c
index 40590a2..3e292a7 100644
--- a/src/io.c
+++ b/src/io.c
@@ -487,7 +487,7 @@ int apk_file_get_info(int atfd, const char *filename, unsigned int flags,
.device = st.st_dev,
};
- if (checksum == APK_CHECKSUM_NONE)
+ if (checksum == APK_CHECKSUM_NONE || S_ISDIR(st.st_mode))
return 0;
if ((flags & APK_FI_NOFOLLOW) && S_ISLNK(st.st_mode)) {