[Tarantool-patches] [PATCH] xlog: make log directory if needed

Cyrill Gorcunov gorcunov at gmail.com
Mon Jun 29 15:48:08 MSK 2020


On Mon, Jun 29, 2020 at 03:44:19PM +0300, Ilya Kosarev wrote:
...
>  
> +/** Make missing directories from the path. */
> +int
> +make_dir(char *path)
> +{
> +	char *path_sep = path;
> +	while (*path_sep == '/') {
> +		/* Don't create root */
> +		++path_sep;
> +	}

There is a helper function, please make sure that
1) path is having EOS
2) you don't go outside of path memory

IOW, I think you should pass some @len parameter
as well and return -1 in case if path is full of '/'
symbols without EOS.


More information about the Tarantool-patches mailing list