From c406949226fe5759473f13b5eb1fcf48c32d67ea Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 22 Sep 2011 15:59:18 -0500 Subject: 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 --- lib/libalpm/be_sync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 5477eff4..4864616b 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -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; } -- cgit v1.2.3-70-g09d2