[CRIU] [PATCH] mount: check bondaries in mount_resolve_path

Cyrill Gorcunov gorcunov at gmail.com
Tue Mar 18 04:40:48 PDT 2014


On Tue, Mar 18, 2014 at 03:31:56PM +0400, Andrey Vagin wrote:
> The current code think that /vz/lxc/centos-6-x86_64-root is
> in /vz/lxc/centos-6-x86_64.
> 
> If the path is not equal to mountpoint, we need to check, that
> path contains a slash after mountpoint.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  mount.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mount.c b/mount.c
> index cdf0335..1d59191 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -158,6 +158,8 @@ static struct mount_info *mount_resolve_path(const char *path)
>  
>  			if (strncmp(c->mountpoint, path, min(n, pathlen)))
>  				continue;
> +			if (n < pathlen && path[n] != '/')
> +				continue;

Don't you want it to be path[n - 1] != '/' ?


More information about the CRIU mailing list