[CRIU] Re: [PATCH] sk-unix.c: Don't mangle name provided by diag message if no mount point present

Andrew Vagin avagin at parallels.com
Thu Aug 30 10:53:11 EDT 2012


On Thu, Aug 30, 2012 at 06:15:45PM +0400, Cyrill Gorcunov wrote:
> Otherwise we can't fetch stat.
> 
> Reported-by: "Muralidhar, Rajeev D" <rajeev.d.muralidhar at intel.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  sk-unix.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/sk-unix.c b/sk-unix.c
> index 9a9323c..5758f69 100644
> --- a/sk-unix.c
> +++ b/sk-unix.c
> @@ -277,7 +277,10 @@ static int unix_collect_one(const struct unix_diag_msg *m,
>  			}
>  
>  			uv = RTA_DATA(tb[UNIX_DIAG_VFS]);
> -			snprintf(rpath, sizeof(rpath), ".%s", name);
> +			if (mntns_root >= 0)
> +				snprintf(rpath, sizeof(rpath), ".%s", name);
> +			else
> +				snprintf(rpath, sizeof(rpath), "%s", name);
We should initialize mnt_root = open("/", O_RONLY)
>  			if (fstatat(mntns_root, rpath, &st, 0)) {
>  				pr_perror("Can't stat socket %d(%s)",
>  						m->udiag_ino, rpath);
> -- 
> 1.7.7.6
> 


More information about the CRIU mailing list