]> dgit.raspbian.org Git - git-annex.git/commit
use getSymbolicLinkStatus not getFileStatus to avoid crash on broken symlink
authorJoey Hess <joeyh@joeyh.name>
Mon, 5 Sep 2022 17:44:03 +0000 (13:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 5 Sep 2022 17:46:32 +0000 (13:46 -0400)
commit8a4cfd4f2d672b57a97e53b6d141378770171e66
treeea6e95c7b45d3760938c877fa6ee2704069a99a1
parent600d3f71416b3f5107b186328a64f2ad66deeb4d
use getSymbolicLinkStatus not getFileStatus to avoid crash on broken symlink

Fix crash importing from a directory special remote that contains a broken
symlink.

The crash was in listImportableContentsM but some other places in
Remote.Directory also seemed like they could have the same problem.

Also audited for other places that have such a problem. Not all calls
to getFileStatus are bad, in some cases it's better to crash on something
unexpected. For example, `git-annex import path` when the path is a broken
symlink should crash, the same as when it does not exist. Many of the
getFileStatus calls are like that, particularly when they involve
.git/annex/objects which should never have a broken symlink in it.

Fixed a few other possible cases of the problem.

Sponsored-by: Lawrence Brogan on Patreon
CHANGELOG
CmdLine/Seek.hs
Git.hs
Limit.hs
Remote/Ddar.hs
Remote/Directory.hs
Utility/InodeCache.hs
Utility/MoveFile.hs
Utility/Url.hs
doc/bugs/Broken_symlinks_in_directory_remote_causes_crash.mdwn