summaryrefslogtreecommitdiff
path: root/src/audit.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-14 19:14:05 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-14 19:14:05 +0300
commit981bc118f8bdf1df6c23c096a52c890a87ee3e5e (patch)
tree73063efdb73ce4ee3511cc827181ff9c6b28427e /src/audit.c
parente9eaedff5071b94d166973f13df90e47ff4936fe (diff)
downloadapk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.gz
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.bz2
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.xz
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.zip
db: live with sha1 and md5
this also convers scripts file to a tar archive.
Diffstat (limited to 'src/audit.c')
-rw-r--r--src/audit.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/audit.c b/src/audit.c
index 7a34f15..2c5a17a 100644
--- a/src/audit.c
+++ b/src/audit.c
@@ -46,7 +46,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(tmp, &fi) < 0)
+ if (apk_file_get_info(tmp, APK_CHECKSUM_NONE, &fi) < 0)
continue;
if (S_ISDIR(fi.mode)) {
@@ -57,8 +57,10 @@ static int audit_directory(apk_hash_item item, void *ctx)
} else {
dbf = apk_db_file_query(db, bdir, APK_BLOB_STR(de->d_name));
if (dbf != NULL) {
- if (apk_blob_compare(APK_BLOB_BUF(fi.csum),
- APK_BLOB_BUF(dbf->csum)) == 0)
+ if (apk_file_get_info(tmp, dbf->csum.type, &fi) < 0)
+ continue;
+
+ if (apk_checksum_compare(&fi.csum, &dbf->csum) == 0)
continue;
reason = 'U';