summaryrefslogtreecommitdiff
path: root/Fields.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-11 15:43:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-11 16:03:45 -0400
commit5387b44657d01e436282e3ae6650a8f083b5ef00 (patch)
treec208fb8505e28d1998ea96a1cf63929e9053749d /Fields.hs
parent4979c878da4dcacf699b4d0b2e2f173e0d0bd06e (diff)
safe recv-key in direct mode
Checks the key's size and checksum. This is sorta expensive, but it avoids needing to add another round-trip to the protocol.
Diffstat (limited to 'Fields.hs')
-rw-r--r--Fields.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Fields.hs b/Fields.hs
index 145a8adca..ffd273be6 100644
--- a/Fields.hs
+++ b/Fields.hs
@@ -30,3 +30,6 @@ associatedFile :: Field
associatedFile = Field "associatedfile" $ \f ->
-- is the file a safe relative filename?
not (isAbsolute f) && not ("../" `isPrefixOf` f)
+
+direct :: Field
+direct = Field "direct" $ \f -> f == "1"