Brandon Williams <[email protected]> writes:
>> How does this relate to the 5-patch real_path: series that has been
>> on 'next' since last year?
>
> The only difference should be in the first patch of the series which
> handles the #define a bit differently due to the discussion that
> happened last week.
>
> Here is the interdiff between v5 and 'origin/bw/realpath-wo-chdir':
Then can you make that an incremental patch (or two) with its own
log message instead? It (or they) would look and smell like a
bugfix patch that follows up a change that has already landed. As
you know, we won't eject and replace patches that are already in
'next' during a development cycle.
Thanks.
>
> diff --git a/abspath.c b/abspath.c
> index 1d56f5ed9..fce40fddc 100644
> --- a/abspath.c
> +++ b/abspath.c
> @@ -62,7 +62,9 @@ static void get_root_part(struct strbuf *resolved, struct
> strbuf *remaining)
> }
>
> /* We allow "recursive" symbolic links. Only within reason, though. */
> -#define MAXSYMLINKS 5
> +#ifndef MAXSYMLINKS
> +#define MAXSYMLINKS 32
> +#endif
>
> /*
> * Return the real path (i.e., absolute path, with symlinks resolved
> @@ -139,6 +141,8 @@ char *strbuf_realpath(struct strbuf *resolved, const char
> *path,
> strbuf_reset(&symlink);
>
> if (num_symlinks++ > MAXSYMLINKS) {
> + errno = ELOOP;
> +
> if (die_on_error)
> die("More than %d nested symlinks "
> "on path '%s'", MAXSYMLINKS, path);