display any illegal character found in ssh comment
This commit is contained in:
parent
c46b263fde
commit
768f7c87f2
1 changed files with 4 additions and 3 deletions
|
@ -82,9 +82,10 @@ validateSshPubKey pubkey = either error return $ check $ words pubkey
|
||||||
where
|
where
|
||||||
(ssh, keytype) = separate (== '-') prefix
|
(ssh, keytype) = separate (== '-') prefix
|
||||||
|
|
||||||
checkcomment comment
|
checkcomment comment = case filter (not . safeincomment) comment of
|
||||||
| all (\c -> isAlphaNum c || c == '@' || c == '-' || c == '_' || c == '.') comment = ok
|
[] -> ok
|
||||||
| otherwise = err "bad comment in ssh public key"
|
badstuff -> err $ "bad comment in ssh public key (contains: \"" ++ badstuff ++ "\")"
|
||||||
|
safeincomment c = isAlphaNum c || c == '@' || c == '-' || c == '_' || c == '.'
|
||||||
|
|
||||||
addAuthorizedKeys :: Bool -> FilePath -> SshPubKey -> IO Bool
|
addAuthorizedKeys :: Bool -> FilePath -> SshPubKey -> IO Bool
|
||||||
addAuthorizedKeys rsynconly dir pubkey = boolSystem "sh"
|
addAuthorizedKeys rsynconly dir pubkey = boolSystem "sh"
|
||||||
|
|
Loading…
Add table
Reference in a new issue