On Thu, Oct 22, 2015 at 02:46:48PM +0000, Serge Hallyn wrote: > Quoting Christian Brauner ([email protected]): > > The mount_entry_overlay_dirs() and mount_entry_aufs_dirs() functions create > > workdirs and upperdirs for overlay and aufs lxc.mount.entry entries. They > > try > > to make sure that the workdirs and upperdirs can only be created under the > > containerdir (e.g. /path/to/the/container/CONTAINERNAME). In order to do > > this > > the right hand side of > > > > if ((strncmp(upperdir, lxcpath, dirlen) == 0) && > > (strncmp(upperdir, rootfs->path, rootfslen) != 0)) > > > > was thought to check if the rootfs->path is not present in the workdir and > > upperdir mount options. But the current check is bogus since it will be > > trivially true whenever the container is a block-dev or overlay or aufs > > backed > > since the rootfs->path will then have a form like e.g. > > > > overlayfs:/some/path:/some/other/path > > > > This patch adds the function ovl_get_rootfs_dir() which parses rootfs->path > > by > > searching backwards for the first occurrence of the delimiter pair ":/". We > > do > > not simply search for ":" since it might be used in path names. If ":/" is > > not > > found we assume the container is directory backed and simply return > > strdup(rootfs->path). > > > > Signed-off-by: Christian Brauner <[email protected]> > > Thanks! > > (fwiw i would have still have the success path for > mount_entry_create_*_dirs set a fnret = 0 and fall through > the err case, but the shared cleanup is short enough it's > not worth a resend) >
I include this in the patch when for the creation of random workdirs with mkdtemp().
signature.asc
Description: PGP signature
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
