From bd01cda59538f7dc266f7ee254cdc1b15ccb3a56 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 13 Dec 2008 17:18:40 +0000 Subject: [PATCH] typo in the last commit svn: r12832 --- collects/scheme/sandbox.ss | 43 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/collects/scheme/sandbox.ss b/collects/scheme/sandbox.ss index f24678caea..0e86c68da3 100644 --- a/collects/scheme/sandbox.ss +++ b/collects/scheme/sandbox.ss @@ -119,27 +119,28 @@ (make-parameter (lambda (what . xs) (error what "network access denied: ~e" xs)))) -(define (make-default-sandbox-guard orig-security) - (make-security-guard - orig-security - (lambda (what path modes) - (when path - (let ([needed (let loop ([order permission-order]) - (cond [(null? order) - (error 'default-sandbox-guard - "unknown access modes: ~e" modes)] - [(memq (car order) modes) (car order)] - [else (loop (cdr order))]))] - [bpath (parameterize ([current-security-guard orig-security]) - (path->bytes (simplify-path* path)))]) - (unless (ormap (lambda (perm) - (and (perm<=? needed (car perm)) - (regexp-match (cadr perm) bpath))) - (sandbox-path-permissions)) - (error what "`~a' access denied for ~a" - (string-append* (add-between (map symbol->string modes) "+")) - path))))) - (lambda args (apply (sandbox-network-guard) args)))) +(define (make-default-sandbox-guard) + (let ([orig-security (current-security-guard)]) + (make-security-guard + orig-security + (lambda (what path modes) + (when path + (let ([needed (let loop ([order permission-order]) + (cond [(null? order) + (error 'default-sandbox-guard + "unknown access modes: ~e" modes)] + [(memq (car order) modes) (car order)] + [else (loop (cdr order))]))] + [bpath (parameterize ([current-security-guard orig-security]) + (path->bytes (simplify-path* path)))]) + (unless (ormap (lambda (perm) + (and (perm<=? needed (car perm)) + (regexp-match (cadr perm) bpath))) + (sandbox-path-permissions)) + (error what "`~a' access denied for ~a" + (string-append* (add-between (map symbol->string modes) "+")) + path))))) + (lambda args (apply (sandbox-network-guard) args))))) (define sandbox-security-guard (make-parameter make-default-sandbox-guard