Fix the default `sandbox-make-code-inspector'.

It now creates an inspector based on the original code inspector instead
of the (implicit) wrong default used by `make-inspector'.  Change
`sandbox-make-inspector' too, to make it explicit.
(cherry picked from commit 90f7a98dd6)
This commit is contained in:
Eli Barzilay 2011-11-02 17:40:04 -04:00
parent f0db9180b4
commit e3b8195afa
2 changed files with 18 additions and 14 deletions

View File

@ -202,9 +202,11 @@
(define sandbox-exit-handler (make-parameter default-sandbox-exit-handler)) (define sandbox-exit-handler (make-parameter default-sandbox-exit-handler))
(define sandbox-make-inspector (make-parameter make-inspector)) (define sandbox-make-inspector
(make-parameter (lambda () (make-inspector (current-inspector)))))
(define sandbox-make-code-inspector (make-parameter make-inspector)) (define sandbox-make-code-inspector
(make-parameter (lambda () (make-inspector (current-code-inspector)))))
(define sandbox-make-logger (make-parameter current-logger)) (define sandbox-make-logger (make-parameter current-logger))

View File

@ -676,22 +676,24 @@ other resources intact.}
@defparam[sandbox-make-inspector make (-> inspector?)]{ @defparam[sandbox-make-inspector make (-> inspector?)]{
A parameter that determines the procedure used to create the inspector A parameter that determines the (nullary) procedure that is used to
for sandboxed evaluation. The procedure is called when initializing create the inspector for sandboxed evaluation. The procedure is called
an evaluator, and the default parameter value is when initializing an evaluator. The default parameter value is
@racket[make-inspector].} @racket[(lambda () (make-inspector (current-inspector)))].}
@defparam[sandbox-make-code-inspector make (-> inspector?)]{ @defparam[sandbox-make-code-inspector make (-> inspector?)]{
A parameter that determines the procedure used to create the code A parameter that determines the (nullary) procedure that is used to
inspector for sandboxed evaluation. The procedure is called when create the code inspector for sandboxed evaluation. The procedure is
initializing an evaluator, and the default parameter value is called when initializing an evaluator. The default parameter value is
@racket[make-inspector]. The @racket[current-load/use-compiled] @racket[(lambda () (make-inspector (current-code-inspector)))].
handler is setup to still allow loading of bytecode files under the
original code inspector when @racket[sandbox-path-permissions] allows The @racket[current-load/use-compiled] handler is setup to allow loading
it through a @racket['read-bytecode] mode symbol, to make it possible of bytecode files under the original code inspector when
to load libraries.} @racket[sandbox-path-permissions] allows it through a
@racket['read-bytecode] mode symbol, which makes loading libraries
possible.}
@defparam[sandbox-make-logger make (-> logger?)]{ @defparam[sandbox-make-logger make (-> logger?)]{