Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2018-01-01 Thread Duy Nguyen
On Fri, Dec 29, 2017 at 2:50 AM, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Dec 28 2017, Nguyễn Thái Ngọc Duy jotted: > >> stat() may follow a symlink and return stat data of the link's target >> instead of the link itself. We are concerned about the link itself. >> >>

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2018-01-01 Thread Duy Nguyen
On Fri, Dec 29, 2017 at 2:10 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >>> [1] >>> https://public-inbox.org/git/cacsjy8ambksp0mdlradcwn45veenc03b-gq8r8pqprdt9bm...@mail.gmail.com/ >>> >>> dir.c | 2 +- >>> 1 file changed, 1 insertion(+), 1

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2017-12-28 Thread Ævar Arnfjörð Bjarmason
On Thu, Dec 28 2017, Nguyễn Thái Ngọc Duy jotted: > stat() may follow a symlink and return stat data of the link's target > instead of the link itself. We are concerned about the link itself. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > I noticed this while looking at the

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2017-12-28 Thread Junio C Hamano
Junio C Hamano writes: >> [1] >> https://public-inbox.org/git/cacsjy8ambksp0mdlradcwn45veenc03b-gq8r8pqprdt9bm...@mail.gmail.com/ >> >> dir.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/dir.c b/dir.c >> index 7c4b45e30e..edcb7bb462 100644 >>

Re: [PATCH] dir.c: avoid stat() in valid_cached_dir()

2017-12-28 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > stat() may follow a symlink and return stat data of the link's target > instead of the link itself. We are concerned about the link itself. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > I noticed this while looking at the

[PATCH] dir.c: avoid stat() in valid_cached_dir()

2017-12-27 Thread Nguyễn Thái Ngọc Duy
stat() may follow a symlink and return stat data of the link's target instead of the link itself. We are concerned about the link itself. Signed-off-by: Nguyễn Thái Ngọc Duy --- I noticed this while looking at the untracked cache bug [1] but because it's not directly related