do not trust require spec from user code

svn: r7343
This commit is contained in:
Eli Barzilay 2007-09-15 07:09:06 +00:00
parent 45649900e7
commit eb72a0dd93

View File

@ -245,13 +245,14 @@
(directory-list "/tmp") =err> "file access denied" (directory-list "/tmp") =err> "file access denied"
--top-- --top--
;; should work also for module evaluators ;; should work also for module evaluators
(set! ev (make-evaluator `(module foo mzscheme ;; --> NO! Shouldn't make user code require whatever it wants
(require (file ,test-lib))))) ;; (set! ev (make-evaluator `(module foo mzscheme
--eval-- ;; (require (file ,test-lib)))))
x => 123 ;; --eval--
(length (with-input-from-file ,test-lib read)) => 5 ;; x => 123
;; the directory is still not kosher ;; (length (with-input-from-file ,test-lib read)) => 5
(directory-list "/tmp") =err> "file access denied" ;; ;; the directory is still not kosher
;; (directory-list "/tmp") =err> "file access denied"
--top-- --top--
;; explicitly allow access to /tmp ;; explicitly allow access to /tmp
(set! ev (let ([rx (if (eq? 'windows (system-type)) (set! ev (let ([rx (if (eq? 'windows (system-type))