2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

sk-unix: Fix name resolving on nested mount points

In case if socket's cwd lays on nested mount point
we might resolve its path a bit incorrectly
(mount_resolve_path helper should not obtain
 paths with leading dot).

Thus send a path without leading dot for correct
name resolving.

Also add some error messages.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2015-07-30 22:53:00 +03:00 committed by Pavel Emelyanov
parent 7a6e97b096
commit 2143d7e9ca

View File

@ -229,7 +229,7 @@ static int resolve_rel_name(struct unix_sk_desc *sk, const struct fd_parms *p)
} }
if ((st.st_ino == rel_name->udiag_vfs_ino) && if ((st.st_ino == rel_name->udiag_vfs_ino) &&
phys_stat_dev_match(st.st_dev, rel_name->udiag_vfs_dev, ns, path)) { phys_stat_dev_match(st.st_dev, rel_name->udiag_vfs_dev, ns, &path[1])) {
rel_name->dir = xstrdup(dir); rel_name->dir = xstrdup(dir);
if (!rel_name->dir) if (!rel_name->dir)
return -ENOMEM; return -ENOMEM;