Commit 8058be39 by Dwight Engen Committed by Serge Hallyn

clone: only update <rootfs>/etc/hostname if it exists

parent 819554fe
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment