From: Dwight Engen Date: Tue, 16 Jul 2013 14:35:02 +0000 (-0400) Subject: clone: only update /etc/hostname if it exists X-Git-Tag: lxc-1.0.0.alpha1~1^2~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8058be395d46cfabf2dacd7df79e95309619986a;p=thirdparty%2Flxc.git clone: only update /etc/hostname if it exists Signed-off-by: Dwight Engen Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c5aae99dc..b0695bca2 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1987,6 +1987,8 @@ static int clone_update_rootfs(struct lxc_container *c0, ret = snprintf(path, MAXPATHLEN, "%s/etc/hostname", bdev->dest); if (ret < 0 || ret >= MAXPATHLEN) exit(1); + if (!file_exists(path)) + exit(0); if (!(fout = fopen(path, "w"))) { SYSERROR("unable to open %s: ignoring\n", path); exit(0);