From 981bc118f8bdf1df6c23c096a52c890a87ee3e5e Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Tue, 14 Jul 2009 19:14:05 +0300 Subject: db: live with sha1 and md5 this also convers scripts file to a tar archive. --- src/audit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/audit.c') 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'; -- cgit v1.2.3-60-g2f50