Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Revert "pkg repo signing_command: Detect if the command fails and fail early"
Bryan Drewery committed 12 years ago
commit e4dbdd9835160c3766479a5528c02cdf7f6a8e74
parent a359cfa
1 file changed +6 -11
modified libpkg/pkg_repo.c
@@ -40,7 +40,6 @@
#define _WITH_GETLINE
#include <stdio.h>
#include <stdbool.h>
-
#include <sysexits.h>
#include <unistd.h>

#include "pkg.h"
@@ -444,7 +443,7 @@ cmd_sign(char *path, char **argv, int argc, struct sbuf **sig, struct sbuf **cer
	char *line = NULL;
	size_t linecap = 0;
	ssize_t linelen;
-
	int i, ret = EPKG_OK;
+
	int i;

	if (sha256_file(path, sha256) != EPKG_OK)
		return (EPKG_FATAL);
@@ -460,17 +459,12 @@ cmd_sign(char *path, char **argv, int argc, struct sbuf **sig, struct sbuf **cer
	sbuf_done(cmd);

	if ((fp = popen(sbuf_data(cmd), "r+")) == NULL) {
-
		ret = EPKG_FATAL;
-
		goto done;
+
		sbuf_delete(cmd);
+
		return (EPKG_FATAL);
	}

	fprintf(fp, "%s\n", sha256);

-
	if (pclose(fp) != EX_OK) {
-
		ret = EPKG_FATAL;
-
		goto done;
-
	}
-

	if (*sig == NULL)
		*sig = sbuf_new_auto();
	if (*cert == NULL)
@@ -497,11 +491,12 @@ cmd_sign(char *path, char **argv, int argc, struct sbuf **sig, struct sbuf **cer

	sbuf_finish(*sig);
	sbuf_finish(*cert);
-
done:
+

	if (cmd)
		sbuf_delete(cmd);
+
	pclose(fp);

-
	return (ret);
+
	return (EPKG_OK);
}

static int