machinectl: allow --setenv=FOO
This commit is contained in:
@@ -2510,7 +2510,7 @@ static int help(int argc, char *argv[], void *userdata) {
|
||||
" --kill-who=WHO Who to send signal to\n"
|
||||
" -s --signal=SIGNAL Which signal to send\n"
|
||||
" --uid=USER Specify user ID to invoke shell as\n"
|
||||
" -E --setenv=VAR=VALUE Add an environment variable for shell\n"
|
||||
" -E --setenv=VAR[=VALUE] Add an environment variable for shell\n"
|
||||
" --read-only Create read-only bind mount\n"
|
||||
" --mkdir Create directory before bind mounting, if missing\n"
|
||||
" -n --lines=INTEGER Number of journal entries to show\n"
|
||||
@@ -2765,13 +2765,9 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
if (!env_assignment_is_valid(optarg))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Environment assignment invalid: %s", optarg);
|
||||
|
||||
r = strv_extend(&arg_setenv, optarg);
|
||||
r = strv_env_replace_strdup_passthrough(&arg_setenv, optarg);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
return log_error_errno(r, "Cannot assign environment variable %s: %m", optarg);
|
||||
break;
|
||||
|
||||
case ARG_MAX_ADDRESSES:
|
||||
|
||||
Reference in New Issue
Block a user