зеркало из https://github.com/microsoft/git.git
real_path: set errno when max number of symlinks is exceeded
Set errno to ELOOP when the maximum number of symlinks is exceeded, as would be done by other symlink-resolving functions. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
7aeb81f1de
Коммит
0b9864aa28
|
@ -141,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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче