summaryrefslogtreecommitdiff
path: root/p11-kit/p11-kit.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-09 12:24:40 +0200
committerStef Walter <stef@thewalter.net>2013-07-09 12:24:40 +0200
commiteca5a6e491f5f85ba1f06afcea3177c3442ae557 (patch)
treee04be5284a0525b5c190b4a46c1548a0c49645f0 /p11-kit/p11-kit.c
parenta314ab2aa9dbfcbc8d2d9a84554265e498520a20 (diff)
downloadp11-kit-eca5a6e491f5f85ba1f06afcea3177c3442ae557.tar.gz
trust: Fix the 'p11-kit extract' command
This is supposed to call over to 'trust extract' and wasn't working correctly.
Diffstat (limited to 'p11-kit/p11-kit.c')
-rw-r--r--p11-kit/p11-kit.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/p11-kit/p11-kit.c b/p11-kit/p11-kit.c
index ecee1ff..28c6f4a 100644
--- a/p11-kit/p11-kit.c
+++ b/p11-kit/p11-kit.c
@@ -80,7 +80,7 @@ p11_kit_external (int argc,
return_val_if_fail (path != NULL, 1);
argv[argc] = NULL;
- execvp (path, argv);
+ execv (path, argv);
/* At this point we have no command */
p11_message ("'%s' is not a valid command. See 'p11-kit --help'", argv[0]);
@@ -91,7 +91,25 @@ int
p11_kit_extract (int argc,
char *argv[])
{
- return p11_kit_external (argc, argv);
+ char *path;
+ char **args;
+
+ args = calloc (argc + 2, sizeof (char *));
+ return_val_if_fail (args != NULL, 1);
+
+ args[0] = "trust";
+ memcpy (args + 1, argv, sizeof (char *) * argc);
+ args[argc + 1] = NULL;
+
+ /* Add our libexec directory to the path */
+ path = p11_path_build (BINDIR, args[0], NULL);
+ return_val_if_fail (path != NULL, 1);
+
+ execv (path, args);
+
+ /* At this point we have no command */
+ p11_message ("'%s' is not a valid command. See 'p11-kit --help'", argv[0]);
+ return 2;
}
int