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 5cba40bcd427ef7fdbcd086ffbccd59bb7daa1e9..8396def003e59b3b61f793938ec6a7ab0108804b 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 b8962e9894480a0010326c2ba60800f9400bc1d7..c346f58412e6add45d8d4a42752d2608a068e96a 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;
 }