diff options
author | Brandon Williams <bmwill@google.com> | 2017-01-09 10:50:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-09 11:26:10 -0800 |
commit | 0b9864aa28ba08d7fb901afee1a75a15e4ad431b (patch) | |
tree | 77732f4692453697ef66e9b57086f530d21969d3 /abspath.c | |
parent | 7aeb81f1de6a06c7ebc9a881e3a07591d760c9d6 (diff) | |
download | git-0b9864aa28ba08d7fb901afee1a75a15e4ad431b.tar.gz |
real_path: set errno when max number of symlinks is exceededbw/realpath-wo-chdir
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |