assistant: Improve sanity check for control characters when pairing.

This commit is contained in:
Joey Hess 2015-02-09 16:34:57 -04:00
parent bcf1b59c1b
commit 1316efdc6e
4 changed files with 18 additions and 15 deletions

View file

@ -58,6 +58,15 @@ data PairData = PairData
}
deriving (Eq, Read, Show)
checkSane :: PairData -> Bool
checkSane p = all (not . any isControl)
[ fromMaybe "" (remoteHostName p)
, remoteUserName p
, remoteDirectory p
, remoteSshPubKey p
, fromUUID (pairUUID p)
]
type UserName = String
{- A pairing that is in progress has a secret, a thread that is