]> git.ipfire.org Git - thirdparty/lxc.git/commit
rcfile shouldn't be recorded in lxc_conf if the attempt to load a config file fails
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 28 Mar 2013 15:34:06 +0000 (10:34 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 28 Mar 2013 15:34:06 +0000 (10:34 -0500)
commitf3ca99fd5fe887adbb93ae56ccf629dfdd232070
tree61fedfb44778ffedba1300eefbbaba8726cba408
parentbb787bc51f0a272f6574fe359f0749302e67c550
rcfile shouldn't be recorded in lxc_conf if the attempt to load a config file fails

Though it's more subtle than that.  If the file doesn't exist or we
can't access it, then don't record it.  But if we have parse errors,
then do.

This is mainly to help out API users who try to read a container
configuration file before calling c->create().  If the file doesn't
exist, then without this patch the subsequent create() will not
use the default /etc/lxc/default.conf.  The API user could check
for the file ahead of time, but this check makes his life easier
without costing us anything.

Signed-off-by: S.Çağlar Onur" <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/confile.c