You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm thinking of using ABCL as a simple scripting language inside of a Minecraft mod. Since all the text is user controlled (and possibly running on a public server) I'm sure you can see why allowing jcall and jstatic would be a bad idea.
My questions are:
How do I give ABCL the least amount of privilege? It shouldn't be able to do whatever it wants with Java, it shouldn't be able to get any information about the system.
How do I add my own symbol to ABCL, the docs talk about converting Java objects to Lisp values which sounds right, but I might be misunderstanding.
The text was updated successfully, but these errors were encountered:
In general there is no way to "lock down" a given instance of ABCL (or any Common Lisp implementation) so that the eval of arbitrary expressions can be restricted in a meaningful way. One usually defines a "smaller" language for ones needs which is carefully restricted to the capabilities one wishes to expose from the host, and implements an carefully restricted interpreter for that domain specific language. Unfortunately, this is usually a lot more work than one wants to do when one just wants to use ABCL as a scripting language.
Just adding a symbol is trivially easy:
(intern 'my-own-symbol)
But I guess that you are probably after adding a symbol bound to callable Lisp function interfacing to something coded in Java? The easiest way to do this is ensure that the required Java classes are present in the ABCL's runtime classpath, then write a little bit of Lisp code from either the java or jss packaging to glue calling that function. When ABCL starts up, arrange that this Lisp glue code defining the function interface is run via specifying code to run via --load command line arguments or by modifying the contents of the system.lisp file, and voila!
To do the equivalent entirely in Java is also possible, but is rather more difficult as one is essentially extending ABCL. To go this route, you should study the implementation a bit, perhaps by studying how primitives are defined.
@Burkino One proposed way to do "sandboxing" in Common Lisp is via First-class Global Environments. This hasn't been implemented in any CL implementation yet, though.
So I'm thinking of using ABCL as a simple scripting language inside of a Minecraft mod. Since all the text is user controlled (and possibly running on a public server) I'm sure you can see why allowing
jcall
andjstatic
would be a bad idea.My questions are:
The text was updated successfully, but these errors were encountered: