git style filename quoting for giveup
authorJoey Hess <joeyh@joeyh.name>
Mon, 10 Apr 2023 16:56:45 +0000 (12:56 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 10 Apr 2023 16:56:45 +0000 (12:56 -0400)
commit063c00e4f7b612bddbca2cc2bc53b93c8c7747df
tree4105bd57f8ab93d12c158ab9bdcd917bca1d706c
parentda83652c760abf66819603e99c0a94b857050c85
git style filename quoting for giveup

When the filenames are part of the git repository or other files that
might have attacker-controlled names, quote them in error messages.

This is fairly complete, although I didn't do the one in
Utility.DirWatcher.INotify.hs because that doesn't have access to
Git.Filename or Annex.

But it's also quite possible I missed some. And also while scanning for
these, I found giveup used with other things that could be attacker
controlled to contain control characters (eg Keys). So, I'm thinking
it would also be good for giveup to just filter out control characters.
This commit is then not the only line of defence, but just good
formatting when git-annex displays a filename in an error message.

Sponsored-by: Kevin Mueller on Patreon
Annex/Ingest.hs
Command/Add.hs
Command/Import.hs
Command/ReKey.hs
Command/Reinject.hs
Command/TestRemote.hs
Command/Undo.hs
Git/Filename.hs