Ensure database validity flags are set in invalid signature case

We returned the right error code but never set the flags accordingly.
Also, now that we can bail early, ensure we set the error code.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-09-22 15:59:18 -05:00
parent 1e0ed133f4
commit c406949226
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,7 @@ static int sync_db_validate(alpm_db_t *db)
return 0;
}
if(db->status & DB_STATUS_INVALID) {
db->handle->pm_errno = ALPM_ERR_DB_INVALID_SIG;
return -1;
}
@ -117,6 +118,8 @@ static int sync_db_validate(alpm_db_t *db)
} while(retry);
if(ret) {
db->status &= ~DB_STATUS_VALID;
db->status |= DB_STATUS_INVALID;
db->handle->pm_errno = ALPM_ERR_DB_INVALID_SIG;
return 1;
}