mailmap: do not respect symlinks for in-tree .mailmap
authorJeff King <peff@peff.net>
Tue, 16 Feb 2021 14:44:37 +0000 (09:44 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Feb 2021 17:41:33 +0000 (09:41 -0800)
commitadcd9f54729e41aa63c3a1b80a19023ea8ede203
tree22803d5cdcabd2fb680db6515df36d58bcfbef80
parentfeb9b7792f0963a818f825bd99be4cda4e8226a5
mailmap: do not respect symlinks for in-tree .mailmap

As with .gitattributes and .gitignore, we would like to make sure that
.mailmap files are handled consistently whether read from the a blob (as
is the default behavior in a bare repo) or from the filesystem.
Likewise, we would like to avoid reading out-of-tree files pointed to by
a symlink, which could have security implications in certain setups.

We can cover both by using open_nofollow() when opening the in-tree
files. We'll continue to follow links for mailmap.file, as well as when
reading .mailmap from the current directory when outside of a repository
entirely.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mailmap.c
t/t4203-mailmap.sh