chiark / gitweb /
nspawn: catch config mistake of specifying -b and args
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Feb 2013 13:10:51 +0000 (14:10 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Feb 2013 13:11:11 +0000 (14:11 +0100)
man/systemd-nspawn.xml
src/nspawn/nspawn.c

index 5cba40b..8396def 100644 (file)
                                 <listitem><para>Automatically search
                                 for an init binary and invoke it
                                 instead of a shell or a user supplied
-                                program.</para></listitem>
+                                program. A command to execute cannot
+                                be specified in this case.
+                                </para></listitem>
                         </varlistentry>
 
                         <varlistentry>
index b8962e9..c346f58 100644 (file)
@@ -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;
 }