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

Andrey Vagin avagin at openvz.org
Tue Mar 18 04:31:56 PDT 2014


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;
 
 			m = c;
 			break;
-- 
1.8.5.3



More information about the CRIU mailing list