From 41f15a00802190468c6b767a05f0a840df79c41a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 30 Dec 2010 18:40:01 +0000 Subject: [PATCH] ITS#6684 fix ppolicy crash, fix Makefile install target --- contrib/slapd-modules/autogroup/Makefile | 15 +++++++++++---- contrib/slapd-modules/autogroup/autogroup.c | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/contrib/slapd-modules/autogroup/Makefile b/contrib/slapd-modules/autogroup/Makefile index 3c1f1d2151..70146ac648 100644 --- a/contrib/slapd-modules/autogroup/Makefile +++ b/contrib/slapd-modules/autogroup/Makefile @@ -2,6 +2,13 @@ LIBTOOL=../../../libtool CPPFLAGS+=-I../../../include -I../../../servers/slapd +ldap_subdir = openldap +prefix=/usr/local +exec_prefix = $(prefix) +libdir = $(exec_prefix)/lib +libexecdir = $(exec_prefix)/libexec +moduledir = $(exec_prefix)/libexec/$(ldap_subdir) + all: autogroup.la autogroup.lo: autogroup.c @@ -9,12 +16,12 @@ autogroup.lo: autogroup.c autogroup.la: autogroup.lo $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \ - -rpath $(PREFIX)/lib -module -o $@ $? + -rpath $(libdir) -module -o $@ $? clean: rm -f autogroup.lo autogroup.la install: autogroup.la - mkdir -p $(PREFIX)/lib/openldap - $(LIBTOOL) --mode=install cp autogroup.la $(PREFIX)/lib/openldap - $(LIBTOOL) --finish $(PREFIX)/lib + mkdir -p $(DESTDIR)$(moduledir) + $(LIBTOOL) --mode=install cp autogroup.la $(DESTDIR)$(moduledir) + $(LIBTOOL) --finish $(DESTDIR)$(moduledir) diff --git a/contrib/slapd-modules/autogroup/autogroup.c b/contrib/slapd-modules/autogroup/autogroup.c index caa7ea1f60..a71a083473 100644 --- a/contrib/slapd-modules/autogroup/autogroup.c +++ b/contrib/slapd-modules/autogroup/autogroup.c @@ -1712,7 +1712,7 @@ autogroup_db_open( Debug( LDAP_DEBUG_TRACE, "==> autogroup_db_open\n", 0, 0, 0); - if ( agi == NULL ) { + if ( agi == NULL || !( slapMode & SLAP_SERVER_MODE )) { return 0; } -- 2.39.5