handle edge case of symlink to something that is not really a pointer file
authorJoey Hess <joeyh@joeyh.name>
Mon, 14 Jun 2021 15:29:49 +0000 (11:29 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 14 Jun 2021 15:35:52 +0000 (11:35 -0400)
commit26a9ea12d11f85b43987d863449c790f7320d9d1
treee867c8557d28b40301a975a9bbf102cb15403343
parent673b2feaf3cdabf267908377c02927f759907295
handle edge case of symlink to something that is not really a pointer file

That seems very unlikely to happen, but still, it's possible it could.
And with the recent addition of locked files to the keys db, this could
be called by places that did not call it before, so it seems even more
important it's correct.

Adds an extra stat of the file, and is potentially racy, but both
problems are fixed by the unix-2.8.0 path. I have not tested that path
builds because that package is not yet released and it would be difficult
to install it since it's tightly tied to a ghc version.
Annex/Link.hs