diff options
author | Francesc Campoy <campoy@golang.org> | 2014-08-01 15:04:49 -0700 |
---|---|---|
committer | Francesc Campoy <campoy@golang.org> | 2014-08-01 15:04:49 -0700 |
commit | cf8082eec5232d8074be664cef7ce8020c1a6bc7 (patch) | |
tree | 58ee15f665844d92323f70e22be8a6643199b74c /playground | |
parent | 149e03031883e8d3b65441a91d17bf11a19fa6c1 (diff) | |
download | golang-x-tools-cf8082eec5232d8074be664cef7ce8020c1a6bc7.tar.gz |
go.tools/playground: return a better message for code starting with a shebang on non local mode
LGTM=adg, dan.kortschak
R=adg, dan.kortschak, campoy
CC=golang-codereviews
https://golang.org/cl/119160043
Diffstat (limited to 'playground')
-rw-r--r-- | playground/socket/socket.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/playground/socket/socket.go b/playground/socket/socket.go index 8f4d12d39..9b4466498 100644 --- a/playground/socket/socket.go +++ b/playground/socket/socket.go @@ -176,8 +176,12 @@ func startProcess(id, body string, out chan<- *Message, opt *Options) *process { done: make(chan struct{}), } var err error - if path, args := shebang(body); RunScripts && path != "" { - err = p.startProcess(path, args, body) + if path, args := shebang(body); path != "" { + if RunScripts { + err = p.startProcess(path, args, body) + } else { + err = errors.New("script execution is not allowed") + } } else { err = p.start(body, opt) } |