on master help sign in
Don't check hostname on network connections to REPL from editors.

It's already restricted to only listening on the 127.0.0.1 interface; the additional check might just be being paranoid. Doesn't seem like this kind of thing is a huge security concern, anyways. Fixes #916. Think I saw someone else complain about this too, recently.

commitabd3c34bb0b6dfd12c6321d576df2595645053ac authorLeif Warner <abimelech@gmail.com> dateSat 22 Feb 2014, 21:28 (13 years ago) parent69c8668
1 file changed+5−13
src/Idris/REPL.hs+5−13
src/Idris/REPL.hs+5−13
@@ -142,19 +142,11 @@ startServer orig fn_in = do tid <- runIO $ forkOS serverLoop
142142 _ -> ""
143143
144144 loop fn ist sock
145− = do (h,host,_) <- accept sock
146− -- just use the local part of the hostname
147− -- for the "localhost.localdomain" case
148− if ((takeWhile (/= '.') host) == "localhost" ||
149− host == "127.0.0.1")
150− then do
151− cmd <- hGetLine h
152− (ist', fn) <- processNetCmd orig ist h fn cmd
153− hClose h
154− loop fn ist' sock
155− else do
156− putStrLn $ "Closing connection attempt from non-localhost " ++ host
157− hClose h
145+ = do (h,_,_) <- accept sock
146+ cmd <- hGetLine h
147+ (ist', fn) <- processNetCmd orig ist h fn cmd
148+ hClose h
149+ loop fn ist' sock
158150
159151processNetCmd :: IState -> IState -> Handle -> FilePath -> String ->
160152 IO (IState, FilePath)