[erlang-questions] Preventing calling some functions

Kiran Khaladkar kiran.khaladkar@REDACTED
Fri Dec 11 16:39:03 CET 2009


Vlad Dumitrescu wrote:
> Hi,
>
> On Fri, Dec 11, 2009 at 11:07, Joe Armstrong <erlang@REDACTED> wrote:
>   
>> It's a but tricky but doable.
>> You need to do a parse transform of the source code, the parse transform can
>> decide which functions are legal.
>>     
>
> This only addresses calling code, but one might even want to be able
> to filter out certain processes so that messages can't be sent to them
> (given that many APIs can be bypassed by directly sending a message to
> the process that handles the functionality).
>
> This is much more difficult to do. If the plugin doesn't use
> processes, then it's possible to filter out all 'send's with the parse
> transform above, but if they must be able to communicate with some
> processes but not with others, then the current architecture makes it
> difficult without support from the VM.
>
> It is interesting to think about creating "process sandboxes" inside
> the VM, where processes aren't allowed to communicate across the
> boundaries (some API should allow to specify exceptions, otherwise
> they would be utterly useless). This can be achieved today by using a
> separate VM and a custom communication layer, but it feels too
> heavyweight if we are talking about running possibly many small
> plugins.
>
> best regards,
> Vlad
>   
i suggest
ideal solution could be using spown_opts for setting some flags in VM to 
define what a process can/cannot do :)
for the time being i will have to go ahead with the code transforms as 
Joe suggested
thanks guys,


More information about the erlang-questions mailing list