summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-29 15:58:38 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-29 15:58:38 -0400
commit5ddda2f7684857e90f45c37d030858773e96ee99 (patch)
tree3bd0817f7bd8bd59d860e8a49df55f6198674083
parent3b15adc07352714cb2bed9005ca829e980e033d6 (diff)
downloaddebug-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.hs1
-rw-r--r--Role/Developer.hs7
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