summaryrefslogtreecommitdiffstats
path: root/src/audit.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-05 13:13:52 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-05 13:13:52 +0300
commit46e93295688385af6b4b5d17f97675087a90aba4 (patch)
tree4af28531ab57f08a5ba58841fa9d385a93cdb3ab /src/audit.c
parent856181a0325d39e7d26566f118bc4219e3837a4b (diff)
downloadapk-tools-46e93295688385af6b4b5d17f97675087a90aba4.tar.bz2
apk-tools-46e93295688385af6b4b5d17f97675087a90aba4.tar.xz
io: flag for following symlinks on fstat
usually we are interested on the actual file's length. but audit is interested about the link. so add a flag for this and use it in audit.
Diffstat (limited to 'src/audit.c')
-rw-r--r--src/audit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audit.c b/src/audit.c
index a7cf2f6..d61b321 100644
--- a/src/audit.c
+++ b/src/audit.c
@@ -27,7 +27,7 @@ static int audit_file(struct apk_database *db, struct apk_db_file *dbf,
{
struct apk_file_info fi;
- if (apk_file_get_info(db->root_fd, name, dbf->csum.type, &fi) != 0)
+ if (apk_file_get_info(db->root_fd, name, APK_FI_NOFOLLOW | dbf->csum.type, &fi) != 0)
return 1;
if (dbf->csum.type != APK_CHECKSUM_NONE &&
@@ -62,7 +62,7 @@ static int audit_directory(apk_hash_item item, void *ctx)
snprintf(tmp, sizeof(tmp), "%s/%s", dbd->name, de->d_name);
- if (apk_file_get_info(db->root_fd, tmp, APK_CHECKSUM_NONE, &fi) < 0)
+ if (apk_file_get_info(db->root_fd, tmp, APK_FI_NOFOLLOW, &fi) < 0)
continue;
if ((dbd->flags & APK_DBDIRF_SYMLINKS_ONLY) &&