Re: [PATCH] git-tag: don't use gpg's stdin, stdout when signing tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gerrit Pape schrieb:
 	memset(&gpg, 0, sizeof(gpg));
 	gpg.argv = args;
-	gpg.in = -1;
-	gpg.out = -1;
+	gpg.in = 0;
+	gpg.out = 1;

I assume you mean with this that gpg should read from fd 0 and write to fd 1, IOW, it should use the standard channels. If I am right, then the memset above has initialized gpg as needed already. Then gpg.argv is the only thing you are setting up in struct child_process gpg; but in this case you can use a convenience function...

 	args[0] = "gpg";
 	args[1] = "-bsau";
 	args[2] = signingkey;
-	args[3] = NULL;
...
+	args[3] = "-o";
+	args[4] = signpath;
+	args[5] = unsignpath;
+	args[6] = NULL;
...
+	if (run_command(&gpg)) {

... here (note: no struct child_process needed):

	if (run_command_v_opt(args, 0)) {

(Just in case this patch is required...)

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux