summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-22 17:30:40 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-22 17:50:50 +0100
commit6e18cc9fa078d2a967251017ddb5baefb104b720 (patch)
treeb23a518b2139e669a84d32591d3507fc6dd8dcab /src
parent09d46cfd41d14f65cb5fe8798a6f7d964700fcd0 (diff)
machinectl: parse verify setting client-side
Diffstat (limited to 'src')
-rw-r--r--src/machine/machinectl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 1bda9a083f..ec403e8f33 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -71,7 +71,7 @@ static bool arg_ask_password = true;
static unsigned arg_lines = 10;
static OutputMode arg_output = OUTPUT_SHORT;
static bool arg_force = false;
-static const char* arg_verify = NULL;
+static ImportVerify arg_verify = IMPORT_VERIFY_SIGNATURE;
static const char* arg_dkr_index_url = NULL;
static void pager_open_if_enabled(void) {
@@ -1914,7 +1914,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) {
"sssb",
remote,
local,
- arg_verify,
+ import_verify_to_string(arg_verify),
arg_force);
if (r < 0)
return bus_log_create_error(r);
@@ -1978,7 +1978,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) {
"sssb",
remote,
local,
- arg_verify,
+ import_verify_to_string(arg_verify),
arg_force);
if (r < 0)
return bus_log_create_error(r);
@@ -2051,7 +2051,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
remote,
tag,
local,
- arg_verify,
+ import_verify_to_string(arg_verify),
arg_force);
if (r < 0)
return bus_log_create_error(r);
@@ -2394,7 +2394,11 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_VERIFY:
- arg_verify = optarg;
+ arg_verify = import_verify_from_string(optarg);
+ if (arg_verify < 0) {
+ log_error("Failed to parse --verify= setting: %s", optarg);
+ return -EINVAL;
+ }
break;
case ARG_FORCE: