#include "config.h"
+#include <sys/wait.h>
#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
char *src_base = basename(src_basec);
char *tmp_file_location;
- opkg_msg(NOTICE,"Downloading %s.\n", src);
+ opkg_msg(NOTICE,"Downloading %s\n", src);
if (str_starts_with(src, "file:")) {
const char *file_src = src + 5;
if (res) {
opkg_msg(ERROR, "Failed to download %s, wget returned %d.\n", src, res);
+ if (res == 4)
+ opkg_msg(ERROR, "Check your network settings and connectivity.\n\n");
free(tmp_file_location);
return -1;
}
hash_insert_pkg(pkg, 1);
if (namep) {
- *namep = pkg->name;
+ *namep = xstrdup(pkg->name);
}
return 0;
}
int
opkg_verify_file (char *text_file, char *sig_file)
{
-#if defined HAVE_GPGME
+#if defined HAVE_USIGN
+ int status = -1;
+ int pid;
+
+ if (conf->check_signature == 0 )
+ return 0;
+
+ pid = fork();
+ if (pid < 0)
+ return -1;
+
+ if (!pid) {
+ execl("/usr/sbin/opkg-key", "opkg-key", "verify", sig_file, text_file, NULL);
+ exit(255);
+ }
+
+ waitpid(pid, &status, 0);
+ if (!WIFEXITED(status) || WEXITSTATUS(status))
+ return -1;
+
+ return 0;
+#elif defined HAVE_GPGME
if (conf->check_signature == 0 )
return 0;
int status = -1;