diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-29 15:58:38 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-29 15:58:38 -0400 |
commit | 5ddda2f7684857e90f45c37d030858773e96ee99 (patch) | |
tree | 3bd0817f7bd8bd59d860e8a49df55f6198674083 | |
parent | 3b15adc07352714cb2bed9005ca829e980e033d6 (diff) | |
download | debug-me-5ddda2f7684857e90f45c37d030858773e96ee99.tar.gz |
don't forward other developer's SessionKey control messages to control window
The control window doesn't know it's running for a developer, so it
would prompt to allow these, which was pointless.
-rw-r--r-- | ControlWindow.hs | 1 | ||||
-rw-r--r-- | Role/Developer.hs | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ControlWindow.hs b/ControlWindow.hs index 74514be..fea6351 100644 --- a/ControlWindow.hs +++ b/ControlWindow.hs @@ -133,6 +133,7 @@ askToAllow ochan promptchan responsechan k@(GpgSigned pk _) = do ControlOutputAction $ SessionKeyRejected pk let accept = do putStrLn "Accepting their connection. They can now enter commands in this debug-me session." + putStrLn "(And, you can type in this window to chat with them.)" atomically $ writeTMChan ochan $ ControlOutputAction $ SessionKeyAccepted pk case v of diff --git a/Role/Developer.hs b/Role/Developer.hs index d05710e..960a204 100644 --- a/Role/Developer.hs +++ b/Role/Developer.hs @@ -195,7 +195,12 @@ sendTtyOutput ochan devstate controlinput logger = go go forwardcontrol msg = case msg of User (ControlMessage c) -> fwd c - Developer (ControlMessage c) -> fwd c + Developer (ControlMessage c) -> case control c of + Rejected _ -> return () + SessionKey _ -> return () + SessionKeyAccepted _ -> return () + SessionKeyRejected _ -> return () + ChatMessage _ _ -> fwd c _ -> return () fwd = atomically . writeTMChan controlinput . ControlInputAction . control |