Skip to content

Interpreter allows arbitrary commands to be executed via the comment #1504

Closed
@harendra-kumar

Description

@harendra-kumar

For example:

cueball$ cat test.hs 
#!/usr/bin/env stack
-- stack exec ghci

main = putStrLn "Hello!"

cueball$ stack test.hs
GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( test.hs, interpreted )
Ok, modules loaded: Main.
*Main> 

It can confuse and surprise if one writes a wrong comment.

I have a fix which restricts the commands to runhaskell and runghc in the interpreter mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions