filter out control characters in error messages
authorJoey Hess <joeyh@joeyh.name>
Mon, 10 Apr 2023 17:38:14 +0000 (13:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 10 Apr 2023 17:50:51 +0000 (13:50 -0400)
commitcd544e548b91fe7a940a2221414e3df6f9ca80f9
tree9e51f631ba63674b543100d4293bc64adf43e044
parent063c00e4f7b612bddbca2cc2bc53b93c8c7747df
filter out control characters in error messages

giveup changed to filter out control characters. (It is too low level to
make it use StringContainingQuotedPath.)

error still does not, but it should only be used for internal errors,
where the message is not attacker-controlled.

Changed a lot of existing error to giveup when it is not strictly an
internal error.

Of course, other exceptions can still be thrown, either by code in
git-annex, or a library, that include some attacker-controlled value.
This does not guard against those.

Sponsored-by: Noam Kremen on Patreon
69 files changed:
Annex/Branch.hs
Annex/GitOverlay.hs
Annex/Import.hs
Annex/Ssh.hs
Assistant/DeleteRemote.hs
Assistant/MakeRemote.hs
Assistant/MakeRepo.hs
Assistant/Pairing/MakeRemote.hs
Assistant/Ssh.hs
Assistant/Threads/Merger.hs
Assistant/Threads/TransferWatcher.hs
Assistant/Upgrade.hs
Assistant/WebApp/Configurators/Delete.hs
Assistant/WebApp/Configurators/Edit.hs
Assistant/WebApp/Configurators/Pairing.hs
Assistant/WebApp/Page.hs
Backend/Hash.hs
CmdLine/GitRemoteTorAnnex.hs
CmdLine/Seek.hs
Command/AddUrl.hs
Command/Fix.hs
Command/ImportFeed.hs
Command/Log.hs
Command/ReKey.hs
Command/Reinject.hs
Command/RemoteDaemon.hs
Command/ResolveMerge.hs
Command/SetKey.hs
Command/Smudge.hs
Command/TestRemote.hs
Command/TransferKeys.hs
Command/Undo.hs
Command/Unlock.hs
Command/Whereis.hs
Creds.hs
Crypto.hs
Database/Benchmark.hs
Database/Handle.hs
Git.hs
Git/CatFile.hs
Git/CheckAttr.hs
Git/Construct.hs
Git/DiffTree.hs
Git/PktLine.hs
Git/Sha.hs
Git/Tree.hs
Git/UnionMerge.hs
Limit.hs
Messages/Internal.hs
P2P/Annex.hs
Remote/BitTorrent.hs
Remote/Ddar.hs
Remote/GCrypt.hs
Remote/Helper/Encryptable.hs
Remote/Helper/Ssh.hs
Remote/HttpAlso.hs
Remote/P2P.hs
Remote/Rsync.hs
Remote/WebDAV.hs
RemoteDaemon/Core.hs
Test.hs
Utility/AuthToken.hs
Utility/Base64.hs
Utility/Exception.hs
Utility/Lsof.hs
Utility/SafeOutput.hs [new file with mode: 0644]
Utility/WebApp.hs
doc/todo/terminal_escapes_in_filenames.mdwn
git-annex.cabal