summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-01-09 18:50:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 19:26:10 (GMT)
commit0b9864aa28ba08d7fb901afee1a75a15e4ad431b (patch)
tree77732f4692453697ef66e9b57086f530d21969d3 /abspath.c
parent7aeb81f1de6a06c7ebc9a881e3a07591d760c9d6 (diff)
downloadgit-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.zip
git-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.tar.gz
git-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.tar.bz2
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>
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index 0393213..fce40fd 100644
--- a/abspath.c
+++ b/abspath.c
@@ -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);