[rabbitmq-discuss] Creating an auth plugin (Kerberos)

Simon Lundström simlu at su.se
Wed Feb 13 07:40:55 GMT 2013


Sorry for the delay, I've been busy on other things...

I'm glad to report that the NIF branch of my plugin works on 3.x now
with the "true" code.

On Wed, 2013-01-30 at 13:42:03 +0000, Tim Watson wrote:
> >> Here's what I did. Firstly, I tweaked the package.mk so that the plugin got included in the release bundle,
> > 
> > Please elaborate on this. Why should I do this? I use `make dist` when I
> > build the plugin (see below also).
> > 
> 
> Sure, but if you don't put `RELEASABLE:=true` in the package.mk then the plugin doesn't make it into the right directory.

Ah, I see! I've always just copied/symlinked the .ez.

> >> Then I made sure that the hard coded path which the on_load function uses to locate the image was exactly where $RABBITMQ_PLUGINS_EXPAND_DIR points to, plus the app+vsn/priv/.... etc.
> > 
> > Hm, how did you change the path for on_load?
> > 
> 
> Like I said below, I changed it to look in the *right* place:
> 
> Kinit = "/tmp/rabbitmq-rabbit-plugins-scratch/rabbitmq_auth_backend_kerberos-0.0.0/priv/kinit",
> erlang:load_nif(Kinit, 0).

Oh yeah, right. That path was hardcoded. That is the path that I use...
Sorry about that!

> >> I suspect your problem is that you're not calculating the location of the directory into which the plugins are exploded properly. Take a look at rabbit_plugins:setup/0 to see how all these things are calculated, then try and mimic this behaviour to locate your target directory dynamically (and correctly!) at runtime.

Thanks for that, I'll check it out!

Thanks alot yet again!
- Simon


More information about the rabbitmq-discuss mailing list