]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_container_new: fail on config file parse error
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 28 Jan 2014 13:28:19 +0000 (13:28 +0000)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 29 Jan 2014 09:57:29 +0000 (09:57 +0000)
If we have a bad config file entry, fail.  Otherwise lxc-start
will proceed with a partial configuration.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index aad692f3fdd9f544a183daa00c57cab8cfe78b21..38628908cee5c2ca6e1f9be931984c1a672bfc62 100644 (file)
@@ -3232,8 +3232,8 @@ struct lxc_container *lxc_container_new(const char *name, const char *configpath
                goto err;
        }
 
-       if (file_exists(c->configfile))
-               lxcapi_load_config(c, NULL);
+       if (file_exists(c->configfile) && !lxcapi_load_config(c, NULL))
+               goto err;
 
        if (ongoing_create(c) == 2) {
                ERROR("Error: %s creation was not completed", c->name);