From e0e28b45f9415e6d21fc6e52904f8c1ed1cb6118 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 24 Nov 2015 02:55:55 +0100 Subject: Basic plugin structure --- Makefile | 17 +++++++++++++++++ service_passwords.c | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Makefile create mode 100644 service_passwords.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0b1538b --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +OPENLDAP_SOURCE := ../source/openldap-2.4.40+dfsg + +TARGET = service_passwords +INCLUDE_FLAGS = -I$(OPENLDAP_SOURCE)/include +CFLAGS = $(INCLUDE_FLAGS) -D_REENTRANT -fPIC -Wall -Wextra +LDFLAGS = -G + +all: $(TARGET).so + +clean: + rm -f $(TARGET).o $(TARGET).so + +%.so: %.o + $(LD) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $^ diff --git a/service_passwords.c b/service_passwords.c new file mode 100644 index 0000000..3d5ca6c --- /dev/null +++ b/service_passwords.c @@ -0,0 +1,22 @@ +#include +#include +#include + +#include + +Slapi_PluginDesc bindpdesc = { + .spd_id = "service_passwords", + .spd_vendor = "spline", + .spd_version = "1.0", + .spd_description = "preoperation plugin " + "to authenticate a bind against different passwords" +}; + +int service_passwords_init(Slapi_PBlock *pb) +{ + int rc = 0; + + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_CURRENT_VERSION); + rc |= slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, (void *) &bindpdesc); + return rc; +} -- cgit v1.2.3-1-g7c22