diff options
author | Stef Walter <stefw@redhat.com> | 2014-10-01 17:34:02 +0200 |
---|---|---|
committer | Stef Walter <stefw@redhat.com> | 2014-10-02 11:44:02 +0200 |
commit | a3b1e1c2f2c8c1f14293d8158b6dfeb2a6560908 (patch) | |
tree | 0f24ca1420aca2c6171bd6bea9d71d22bc996236 /p11-kit/p11-kit.c | |
parent | 76f230ced6e9ca2a598988bc00b7b971208e8f64 (diff) |
remote: Run separate executable binary for 'p11-kit remote'
This allows security frameworks like SELinux or AppArmor to target
it specifically.
Diffstat (limited to 'p11-kit/p11-kit.c')
-rw-r--r-- | p11-kit/p11-kit.c | 69 |
1 files changed, 1 insertions, 68 deletions
diff --git a/p11-kit/p11-kit.c b/p11-kit/p11-kit.c index f64359e..a7b9212 100644 --- a/p11-kit/p11-kit.c +++ b/p11-kit/p11-kit.c @@ -39,7 +39,6 @@ #include "message.h" #include "path.h" #include "p11-kit.h" -#include "remote.h" #include <assert.h> #include <ctype.h> @@ -61,12 +60,9 @@ int p11_kit_trust (int argc, int p11_kit_external (int argc, char *argv[]); -int p11_kit_remote (int argc, - char *argv[]); - static const p11_tool_command commands[] = { { "list-modules", p11_kit_list_modules, "List modules and tokens" }, - { "remote", p11_kit_remote, "Run a specific PKCS#11 module remotely" }, + { "remote", p11_kit_external, "Run a specific PKCS#11 module remotely" }, { P11_TOOL_FALLBACK, p11_kit_external, NULL }, { 0, } }; @@ -132,69 +128,6 @@ p11_kit_external (int argc, } int -p11_kit_remote (int argc, - char *argv[]) -{ - CK_FUNCTION_LIST *module; - int opt; - int ret; - - enum { - opt_verbose = 'v', - opt_help = 'h', - }; - - struct option options[] = { - { "verbose", no_argument, NULL, opt_verbose }, - { "help", no_argument, NULL, opt_help }, - { 0 }, - }; - - p11_tool_desc usages[] = { - { 0, "usage: p11-kit remote <module>" }, - { 0 }, - }; - - while ((opt = p11_tool_getopt (argc, argv, options)) != -1) { - switch (opt) { - case opt_verbose: - p11_kit_be_loud (); - break; - case opt_help: - case '?': - p11_tool_usage (usages, options); - return 0; - default: - assert_not_reached (); - break; - } - } - - argc -= optind; - argv += optind; - - if (argc != 1) { - p11_message ("specify the module to remote"); - return 2; - } - - if (isatty (0)) { - p11_message ("the 'remote' tool is not meant to be run from a terminal"); - return 2; - } - - module = p11_kit_module_load (argv[0], 0); - if (module == NULL) - return 1; - - ret = p11_kit_remote_serve_module (module, 0, 1); - p11_kit_module_release (module); - - return ret; -} - - -int main (int argc, char *argv[]) { |