FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 04-10-2011, 11:29 AM
Rémy Oudompheng
 
Default sync.c: check signatures for local package files when available

Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
---
Note that no global option exists to control whether
this check is optional or not.

On branch 'master'

lib/libalpm/sync.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 5428e40..a97a67b 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -828,16 +828,25 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
for(i = trans->add; i; i = i->next, current++) {
pmpkg_t *spkg = i->data;
int percent = (current * 100) / numtargs;
- if(spkg->origin == PKG_FROM_FILE) {
- continue; /* pkg_load() has been already called, this package is valid */
- }
+ const char *filename = alpm_pkg_get_filename(spkg);
+ const pmpgpsig_t *pgpsig = alpm_pkg_get_pgpsig(spkg);
PROGRESS(trans, PM_TRANS_PROGRESS_INTEGRITY_START, "", percent,
numtargs, current);

- const char *filename = alpm_pkg_get_filename(spkg);
+ if(spkg->origin == PKG_FROM_FILE) {
+ if (!pgpsig->encdata && !pgpsig->rawdata)
+ continue;
+ int ret = _alpm_file_checksig(filename, pgpsig);
+ if (ret != 0) {
+ errors++;
+ *data = alpm_list_add(*data, strdup(filename));
+ }
+ /* no checksum verification for package files */
+ continue;
+ }
+
char *filepath = _alpm_filecache_find(filename);
const char *md5sum = alpm_pkg_get_md5sum(spkg);
- const pmpgpsig_t *pgpsig = alpm_pkg_get_pgpsig(spkg);

/* check md5sum first */
if(test_md5sum(trans, filepath, md5sum) != 0) {
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 10:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org