diff options
| author | Xin LI <delphij@FreeBSD.org> | 2015-08-19 18:24:39 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2015-08-19 18:24:39 +0000 |
| commit | 48f92706898f2cd5f8eaa6161b42433eca114cdf (patch) | |
| tree | 040833b5703e600d5f85c8821508d363291139ed /usr.sbin | |
| parent | 5f5df47af838b7366ef8cd22b1525357dd64c18e (diff) | |
Notes
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/pkg/pkg.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 5ae6c19b96d93..e242638e0f8a3 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -767,7 +767,13 @@ bootstrap_pkg(bool force) goto fetchfail; if (signature_type != NULL && - strcasecmp(signature_type, "FINGERPRINTS") == 0) { + strcasecmp(signature_type, "NONE") != 0) { + if (strcasecmp(signature_type, "FINGERPRINTS") != 0) { + warnx("Signature type %s is not supported for " + "bootstrapping.", signature_type); + goto cleanup; + } + snprintf(tmpsig, MAXPATHLEN, "%s/pkg.txz.sig.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP); snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz.sig", @@ -855,7 +861,13 @@ bootstrap_pkg_local(const char *pkgpath, bool force) goto cleanup; } if (signature_type != NULL && - strcasecmp(signature_type, "FINGERPRINTS") == 0) { + strcasecmp(signature_type, "NONE") != 0) { + if (strcasecmp(signature_type, "FINGERPRINTS") != 0) { + warnx("Signature type %s is not supported for " + "bootstrapping.", signature_type); + goto cleanup; + } + snprintf(path, sizeof(path), "%s.sig", pkgpath); if ((fd_sig = open(path, O_RDONLY)) == -1) { |
