[CRIU] [PATCH] crtools: allow only absolute logfile and pidfile paths with -d option

Andrew Vagin avagin at parallels.com
Sun Nov 10 20:41:07 PST 2013


On Mon, Nov 11, 2013 at 06:41:02AM +0400, Ruslan Kuprieiev wrote:
> -d is to be used primarily by some start up scripts, so lets allow only absolute path for confidence.

I don't understand the reason. We use -D to set current dir, so when we
use reletive paths, we undestand where these files are created.

-d is used in zdtm.sh for page-server. Don't forget to fix it there.

> 
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>  crtools.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/crtools.c b/crtools.c
> index 9f0b6e4..20cedbc 100644
> --- a/crtools.c
> +++ b/crtools.c
> @@ -277,6 +277,12 @@ int main(int argc, char *argv[])
>  		}
>  	}
>  
> +	if (opts.restore_detach)
> +		if (opts.output[0] != '/' || opts.pidfile[0] != '/') {
> +			pr_err("-d requires absolute paths for both logfile and pidfile\n");
> +			return -1;
> +		}
> +
>  	log_set_loglevel(log_level);
>  
>  	if (log_init(opts.output))
> -- 
> 1.8.1.2
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list