From c1fe6d08f3ba77bf13b098216fc5e5bcd4ba23f7 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Thu, 30 Jul 2009 11:55:59 +0300 Subject: db: fix checksum storing to db also take precautions in audit code if the db is missing the checksum. --- src/audit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/audit.c') diff --git a/src/audit.c b/src/audit.c index 31965df..76bd492 100644 --- a/src/audit.c +++ b/src/audit.c @@ -69,10 +69,9 @@ 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_file_get_info(tmp, dbf->csum.type, &fi) < 0) - continue; - - if (apk_checksum_compare(&fi.csum, &dbf->csum) == 0) + if (dbf->csum.type != APK_CHECKSUM_NONE && + apk_file_get_info(tmp, dbf->csum.type, &fi) == 0 && + apk_checksum_compare(&fi.csum, &dbf->csum) == 0) continue; reason = 'U'; -- cgit v1.2.3