Permalink
Browse files

FIXED: sandbox handling of @/2. Vladislav Zorov and

Anne Ogborn.
  • Loading branch information...
JanWielemaker committed Jul 16, 2017
1 parent a23eb7d commit a22442fc82fd468f02abb7a19958bb3007dc585b
Showing with 6 additions and 1 deletion.
  1. +4 −1 library/sandbox.pl
  2. +2 −0 src/Tests/unprotected/test_sandbox.pl
View
@@ -229,8 +229,9 @@
safe_clauses(G, M, Parents, Safe0, Safe) :-
predicate_property(M:G, interpreted),
!,
def_module(M:G, MD:QG),
\+ compiled(MD:QG),
!,
findall(Ref-Body, clause(MD:QG, Body, Ref), Bodies),
safe_bodies(Bodies, MD, Parents, Safe0, Safe).
safe_clauses(G, M, [_|Parents], _, _) :-
@@ -242,6 +243,8 @@
throw(error(existence_error(procedure, G),
sandbox(G, Parents))).
compiled(system:(@(_,_))).
%! safe_bodies(+Bodies, +Module, +Parents, +Safe0, -Safe)
%
% Verify the safety of bodies. If a clause was compiled with a
@@ -71,5 +71,7 @@
safe_goal(aggregate(sum(I), X^between(1,X,I), _Count)).
test(dcg, error(permission_error(call, sandboxed, open(_,_,_)))) :-
safe_goal(my_call(open(_,_,_))).
test(contexr, error(permission_error(call, sandboxed, @(_,_)))) :-
safe_goal(@(open(_,_,_), user)).
:- end_tests(sandbox).

0 comments on commit a22442f

Please sign in to comment.