[erlang-questions] Preventing calling some functions
Thu Dec 10 15:41:58 CET 2009
On Dec 10, 2009, at 5:06 AM, Kiran Khaladkar wrote:
> I have a server written in which i allow erlang plugins also. But the problem is i dont want the plugin code the call certain functions such as 'gen_tcp:listen' etc .. The plugin writer should not be able to call certain functions thought he might know all the erlang lib.
> Can anyone suggest a way to do such a thing??
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
Now, don't take what I say as definitive, since I'm still sort of new to Erlang myself, but I don't think that what you are asking is currently possible. I myself was asking the same question just a couple says ago , with the same intent as you (I want to have plugins/scripts that are sandboxed).
One solution would be the implementation of reified environments . I personally believe that their implementation would allow for a much safer Erlang, allowing for the possibility of sandboxed environments that know only about modules that you want it to know about. For example, the plugins could be exposed only to your custom modules plus a few BIFs, if you so wanted.
Maybe someone knows something that I don't though.
- Brentley Jones
More information about the erlang-questions