Pengine - Error: No permission to call sandboxed `name(_G1513,_G1514)'

410 views
Skip to first unread message

dagobi

unread,
Sep 21, 2016, 2:32:07 AM9/21/16
to SWI-Prolog
Got this error with a program (loaded on pengine) that calls name/2. 

How to declare system-defined predicates like name/2 safe for the sandbox?

Thanks much in advance.

-- dagobi

dagobi

unread,
Sep 21, 2016, 2:40:17 AM9/21/16
to SWI-Prolog
A simple example would be to add a call to name/2 in genealogist.pl of the GUI example http://www.swi-prolog.org/pengines/GenealogistGUI.txt, something like

ancestor_decendant(X, Y) :- parent_child(X, Y), name(X,Z).

Then you'd get the sandbox error when ancestor_decendant(X, Y) is asked.

Jan Wielemaker

unread,
Sep 21, 2016, 3:01:55 AM9/21/16
to dagobi, SWI-Prolog
You can redefine (non-ISO) system predicates by defining them before using
them. See http://swish.swi-prolog.org/p/CjGVbTCX.pl

safe_goal/1 is executed on the loaded source and just follows the same
resolution for predicates as execution.

When defining after use your code will resolve to system:name/2.
system:name/2 was not in the safe list. Added, but it will still not
work correctly.

Cheers --- Jan
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

dagobi

unread,
Sep 29, 2016, 12:09:51 AM9/29/16
to SWI-Prolog, zack...@gmail.com
Thanks Jan. We decided to replace name/2 with atom_codes/2.
Reply all
Reply to author
Forward
0 new messages