summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Infra
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-09-25 19:08:33 +0000
committerhallgren <hallgren@chalmers.se>2012-09-25 19:08:33 +0000
commit43d5016996905cc4fd325ecc739d64eb29aa0aa1 (patch)
tree884685ebebbb2c6966d84bbc2c532232e88b91f3 /src/compiler/GF/Infra
parent1adc0ed9f7ef98480f441474353eb39293d988c7 (diff)
Use the SIO monad in the GF shell
+ The restrictions on arbitrary IO when GF is running in restricted mode is now enforced in the types. + This hopefully also solves an intermittent problem when accessing the GF shell through the web API provided by gf -server. This was visible in the Simple Translation Tool and probably caused by some low-level bug in the GHC IO libraries.
Diffstat (limited to 'src/compiler/GF/Infra')
-rw-r--r--src/compiler/GF/Infra/UseIO.hs10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/compiler/GF/Infra/UseIO.hs b/src/compiler/GF/Infra/UseIO.hs
index a9b3cada2..9f2d27f3f 100644
--- a/src/compiler/GF/Infra/UseIO.hs
+++ b/src/compiler/GF/Infra/UseIO.hs
@@ -197,16 +197,6 @@ writeUTF8File fpath content = do
readBinaryFile path = hGetContents =<< openBinaryFile path ReadMode
writeBinaryFile path s = withBinaryFile path WriteMode (flip hPutStr s)
--- * Functions to limit acesss to arbitrary IO and system commands
-restricted io =
- either (const io) (const $ fail message) =<< try (getEnv "GF_RESTRICTED")
- where
- message =
- "This operation is not allowed when GF is running in restricted mode."
-
-restrictedSystem = restricted . system
-
-
-- Because GHC adds the confusing text "user error" for failures cased by
-- calls to fail.
ioErrorText e = if isUserError e