From cb96a2c69a312fb089fef4501650f4fc40a1420b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 24 Feb 2013 14:10:51 +0100 Subject: [PATCH] nspawn: catch config mistake of specifying -b and args --- man/systemd-nspawn.xml | 4 +++- src/nspawn/nspawn.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 5cba40bcd..8396def00 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -170,7 +170,9 @@ Automatically search for an init binary and invoke it instead of a shell or a user supplied - program. + program. A command to execute cannot + be specified in this case. + diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index b8962e989..c346f5841 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -267,6 +267,11 @@ static int parse_argv(int argc, char *argv[]) { } } + if (optind < argc && arg_boot) { + log_error("Cannot specify a command together with '-b'"); + return -EINVAL; + } + return 1; } -- 2.30.2