[CRIU] Re: [PATCH] dump: fix check for service dentries

Pavel Emelyanov xemul at parallels.com
Thu Mar 1 03:43:59 EST 2012


On 03/01/2012 12:35 PM, Kinsbursky Stanislav wrote:
> Without the patch all files,. starting from "." will be ommited.
> Use of strcmp() is safe - look at kernel "filldir" function.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>

Ack

> ---
>  cr-dump.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/cr-dump.c b/cr-dump.c
> index b99e023..7d43b74 100644
> --- a/cr-dump.c
> +++ b/cr-dump.c
> @@ -391,7 +391,9 @@ static int dump_task_files(pid_t pid, struct cr_fdset *cr_fdset,
>  		struct fd_parms p;
>  		int lfd;
>  
> -		if (de->d_name[0] == '.')
> +		if (!strcmp(de->d_name, "."))
> +			continue;
> +		if (!strcmp(de->d_name, ".."))
>  			continue;
>  		if (read_fd_params(pid, de->d_name, &p))
>  			return -1;
> 



More information about the CRIU mailing list