blob: ef36997988684548945b5afe3bdfbf29b60cf8e4 [file] [log] [blame]
--- p11-kit-0.23.1/p11-kit/p11-kit.c.orig 2015-04-13 13:01:51.331355100 +0200
+++ p11-kit-0.23.1/p11-kit/p11-kit.c 2015-04-13 13:09:46.346179100 +0200
@@ -72,6 +72,7 @@
char *argv[])
{
char **args;
+ int code;
args = calloc (argc + 2, sizeof (char *));
return_val_if_fail (args != NULL, 1);
@@ -80,14 +81,18 @@
memcpy (args + 1, argv, sizeof (char *) * argc);
args[argc + 1] = NULL;
- execv (args[0], args);
-
- /* At this point we have no command */
- p11_message_err (errno, "couldn't run trust tool");
+ code = _spawnv (_P_WAIT, args[0], args);
free (argv[0]);
free (args);
- return 2;
+
+ if (code) {
+ /* At this point we have no command */
+ p11_message_err (errno, "couldn't run trust tool");
+ return 2;
+ }
+
+ return 0;
}
int
@@ -97,6 +102,7 @@
const char *private_dir;
char *filename;
char *path;
+ int code;
/* These are trust commands, send them to that tool */
if (strcmp (argv[0], "extract") == 0) {
@@ -118,14 +124,18 @@
return_val_if_fail (path != NULL, 1);
argv[argc] = NULL;
- execv (path, argv);
-
- /* At this point we have no command */
- p11_message ("'%s' is not a valid command. See 'p11-kit --help'", argv[0]);
+ code = _spawnv (_P_WAIT, path, argv);
free (filename);
free (path);
- return 2;
+
+ if (code) {
+ /* At this point we have no command */
+ p11_message ("'%s' is not a valid command. See 'p11-kit --help'", argv[0]);
+ return 2;
+ }
+
+ return 0;
}
int