summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-05 08:27:07 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-05 08:27:07 +0300
commitf78fa317377e889ac59635abc556a92828b5c794 (patch)
tree14aaa788ab2d2768c012428bd57325edfbb69b98 /lib
parent12bb7024fd900ef5fc4468293a41b5cf163b8cdf (diff)
downloadrpm-f78fa317377e889ac59635abc556a92828b5c794.tar.gz
rpm-f78fa317377e889ac59635abc556a92828b5c794.tar.bz2
rpm-f78fa317377e889ac59635abc556a92828b5c794.zip
Check for pipe() returns on GPG and PGP signature creation
Diffstat (limited to 'lib')
-rw-r--r--lib/signature.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/signature.c b/lib/signature.c
index 8c2f8bc8b..2e767c033 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -368,7 +368,10 @@ static int makePGPSignature(const char * file, rpmSigTag * sigTagp,
addMacro(NULL, "__signature_filename", NULL, sigfile, -1);
inpipe[0] = inpipe[1] = 0;
- (void) pipe(inpipe);
+ if (pipe(inpipe) < 0) {
+ rpmlog(RPMLOG_ERR, _("Couldn't create pipe for signing: %m"));
+ goto exit;
+ }
if (!(pid = fork())) {
const char *pgp_path = rpmExpand("%{?_pgp_path}", NULL);
@@ -501,7 +504,10 @@ static int makeGPGSignature(const char * file, rpmSigTag * sigTagp,
addMacro(NULL, "__signature_filename", NULL, sigfile, -1);
inpipe[0] = inpipe[1] = 0;
- (void) pipe(inpipe);
+ if (pipe(inpipe) < 0) {
+ rpmlog(RPMLOG_ERR, _("Couldn't create pipe for signing: %m"));
+ goto exit;
+ }
if (!(pid = fork())) {
const char *gpg_path = rpmExpand("%{?_gpg_path}", NULL);