File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ def fmt_fun(query: Any) -> Any:
233233
234234 except ShellEscapeException as e :
235235 source_code = e .line
236+ if not settings .ENABLE_SYSTEM_COMMANDS :
237+ shell .errmsg ("System commands are disabled in sandboxed mode." )
238+ continue
236239 if len (source_code ) and source_code [1 ] == "!" :
237240 try :
238241 print (open (source_code [2 :], "r" ).read ())
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ def inspect_eval_loop(evaluation: Evaluation):
5454 query , source_code = evaluation .parse_feeder_returning_code (shell )
5555 # show_echo(source_code, evaluation)
5656 if len (source_code ) and source_code [0 ] == "!" and shell is not None :
57+ if not settings .ENABLE_SYSTEM_COMMANDS :
58+ print ("System commands are disabled in sandboxed mode." )
59+ continue
5760 subprocess .run (source_code [1 :], shell = True )
5861 if shell .definitions is not None :
5962 shell .definitions .increment_line_no (1 )
You can’t perform that action at this time.
0 commit comments