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

Simon Lundström simlu at su.se
Wed Jan 30 12:31:06 GMT 2013

On Fri, 2012-12-28 at 14:10:25 +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).

> plus I had to add some noise to the compiler flags in order to build the native library on 64bit Mac OS (Lion).

Hm, I'm on 64bit Mac OS (Lion 10.7.5) and I don't get any noise. I'm
using some flags though:

rabbitmq-public-umbrella/rabbitmq-auth-backend-kerberos$ LDFLAGS="-L/usr/heimdal/lib -undefined dynamic_lookup -dynamiclib" CFLAGS="-I/usr/heimdal/include -I/usr/local/Cellar/erlang/R15B02/lib/erlang/usr/include/" make dist

> 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?

> After this, the plugin loads correctly, the NIF is instantiated properly and I can interact with the kinit module as expected:

Woo! \o/

> 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.

Ah, it seems that you are using 3.x (because I can't find the setup/0 function
in rabbitmq-server/src/rabbit_plugins.erl)? I'm still on 2.8.7 but I'd recon
this is the time to upgrade and make my plugin >3.x only.

- Simon

More information about the rabbitmq-discuss mailing list