Commit 2143d7e9 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7a6e97b0
...@@ -229,7 +229,7 @@ static int resolve_rel_name(struct unix_sk_desc *sk, const struct fd_parms *p) ...@@ -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;
......
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