diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | tools/Makefile.am | 4 | ||||
-rw-r--r-- | tools/tool.c | 15 | ||||
-rw-r--r-- | trust/Makefile.am | 4 | ||||
-rwxr-xr-x | trust/p11-kit-extract-trust.in (renamed from tools/p11-kit-extract-trust.in) | 7 |
6 files changed, 21 insertions, 14 deletions
@@ -107,6 +107,7 @@ x86_64-w64-mingw32 /p11-kit/tests/uri-test /tools/p11-kit -/tools/p11-kit-extract-trust + +/trust/p11-kit-extract-trust /p11-kit-?.? diff --git a/configure.ac b/configure.ac index aa3dfa1..8d88540 100644 --- a/configure.ac +++ b/configure.ac @@ -459,9 +459,9 @@ AC_CONFIG_FILES([Makefile p11-kit/p11-kit-1.pc p11-kit/pkcs11.conf.example tools/Makefile - tools/p11-kit-extract-trust tools/tests/Makefile trust/Makefile + trust/p11-kit-extract-trust trust/tests/Makefile ]) AC_OUTPUT diff --git a/tools/Makefile.am b/tools/Makefile.am index c8296ee..deda642 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -50,8 +50,4 @@ p11_kit_SOURCES += \ save.c save.h \ $(NULL) -externaldir = $(privatedir) -external_SCRIPTS = \ - p11-kit-extract-trust - endif # WITH_ASN1 diff --git a/tools/tool.c b/tools/tool.c index a2dbcbd..313484a 100644 --- a/tools/tool.c +++ b/tools/tool.c @@ -194,20 +194,19 @@ exec_external (const char *command, char *argv[]) { char *filename; - const char *path; - char *env; + char *path; if (!asprintf (&filename, "p11-kit-%s", command) < 0) return_if_reached (); /* Add our libexec directory to the path */ - path = getenv ("PATH"); - if (!asprintf (&env, "PATH=%s%s%s", path ? path : "", path ? P11_PATH_SEP : "", PRIVATEDIR)) - return_if_reached (); - putenv (env); + path = p11_path_build (PRIVATEDIR, filename, NULL); + return_if_fail (path != NULL); argv[0] = filename; - execvp (filename, argv); + argv[argc] = NULL; + + execvp (path, argv); } static void @@ -248,6 +247,8 @@ main (int argc, char *argv[]) if (!command) { skip = true; command = argv[in]; + } else { + skip = false; } /* The global long options */ diff --git a/trust/Makefile.am b/trust/Makefile.am index 4a3430c..6c2c7c8 100644 --- a/trust/Makefile.am +++ b/trust/Makefile.am @@ -56,5 +56,9 @@ libtrust_testable_la_LDFLAGS = \ libtrust_testable_la_SOURCES = $(MODULE_SRCS) +externaldir = $(privatedir) +external_SCRIPTS = \ + p11-kit-extract-trust + EXTRA_DIST = \ p11-kit-trust.module diff --git a/tools/p11-kit-extract-trust.in b/trust/p11-kit-extract-trust.in index b15dd7d..c7214e9 100755 --- a/tools/p11-kit-extract-trust.in +++ b/trust/p11-kit-extract-trust.in @@ -6,7 +6,12 @@ # appropriate. In the future this script will be called when the PKCS#11 # trust module is used to modifiy trust anchors and related data. -echo "p11-kit: the placeholder extract-trust command has not been customized by your distribution." +if [ $# -ne 0 ]; then + echo "usage: p11-kit extract-trust" >&2 + exit 2 +fi + +echo "p11-kit: the placeholder extract-trust command has not been customized by your distribution." >&2 # You can use commands like this to extract data from trust modules # into appropriate locations for your distribution. |