summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:22:59 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:22:59 (EST)
commit4811b041bc4792c6dbdbe9e79d192048b1939982 (patch)
tree40a09c177be0c5dfd5a47ce006314ab32ccd6745
parent5a3980ed0d8d521cea15d4d46e1856c14cdb4bb5 (diff)
opkg: Don't attempt to check the validity of a repository if package did not
come from a known source git-svn-id: http://opkg.googlecode.com/svn/trunk@134 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_install.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index 3db224f..e1a50cc 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -828,22 +828,26 @@ int opkg_install_pkg(opkg_conf_t *conf, pkg_t *pkg, int from_upgrade)
#if HAVE_GPGME
char *list_file_name, *sig_file_name, *lists_dir;
- sprintf_alloc (&lists_dir, "%s",
- (conf->restrict_to_default_dest)
- ? conf->default_dest->lists_dir
- : conf->lists_dir);
- sprintf_alloc (&list_file_name, "%s/%s", lists_dir, pkg->src->name);
- sprintf_alloc (&sig_file_name, "%s/%s.sig", lists_dir, pkg->src->name);
-
- if (file_exists (sig_file_name))
+ /* check to ensure the package has come from a repository */
+ if (pkg->src)
{
- if (opkg_verify_file (conf, list_file_name, sig_file_name))
- return OPKG_INSTALL_ERR_SIGNATURE;
+ sprintf_alloc (&lists_dir, "%s",
+ (conf->restrict_to_default_dest)
+ ? conf->default_dest->lists_dir
+ : conf->lists_dir);
+ sprintf_alloc (&list_file_name, "%s/%s", lists_dir, pkg->src->name);
+ sprintf_alloc (&sig_file_name, "%s/%s.sig", lists_dir, pkg->src->name);
+
+ if (file_exists (sig_file_name))
+ {
+ if (opkg_verify_file (conf, list_file_name, sig_file_name))
+ return OPKG_INSTALL_ERR_SIGNATURE;
+ }
+
+ free (lists_dir);
+ free (list_file_name);
+ free (sig_file_name);
}
-
- free (lists_dir);
- free (list_file_name);
- free (sig_file_name);
#endif
/* Check for md5 values */