Skip to content

Commit

Permalink
include ppm release 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
epictete committed Aug 20, 2019
1 parent 5e748d8 commit c55b12f
Show file tree
Hide file tree
Showing 10 changed files with 1,342 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CHECK_PASSWORD_MINDIGIT="0"
CHECK_PASSWORD_MINPUNCT="0"

PPM_NAME="ltb-project-openldap-ppm"
PPM_VERSION="1.7"
PPM_VERSION="1.8"
PPM_CONF="${LDAPSERVERDIR}/etc/openldap/ppm.conf"

EXPL_NAME="ltb-project-openldap-explockout"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
INSTALLATION
============

Build dependencies
------------------
OpenLDAP sources must be available. For an easier build, copy all ppm module
into contrib/slapd-modules OpenLDAP source directory.

Build
-----
Be sure to have copied ppm module into contrib/slapd-modules OpenLDAP source
directory.

Adapt the Makefile command to indicate:
OLDAP_SOURCES : should point to OpenLDAP source directory
CONFIG: where the ppm.conf configuration file will finally stand
LIBDIR: where the library will be installed
DEBUG: If defined, ppm logs its actions with syslog

If necessary, you can also adapt some OpenLDAP source directories (if changed):
LDAP_INC : OpenLDAP headers directory
LDAP_LIBS : OpenLDAP built libraries directory

then type:

make clean
make CONFIG=/etc/openldap/ppm.conf OLDAP_SOURCES=../../..
make install CONFIG=/etc/openldap/ppm.conf LIBDIR=/usr/lib/openldap


USAGE
=====

Create a password policy entry and indicate the fresh compiled
library ppm.so:

dn: cn=default,ou=policies,dc=my-domain,dc=com
objectClass: pwdPolicy
objectClass: pwdPolicyChecker
objectClass: person
objectClass: top
cn: default
sn: default
pwdAttribute: userPassword
pwdCheckQuality: 2
...
pwdCheckModule: /path/to/new/ppm.so


See slapo-ppolicy for more information, but to sum up:
- add ppolicy schema to your directory
- enable ppolicy overlay
- define a default ppolicy in OpenLDAP configuration or use pwdPolicySubentry
attribute to point to the previous policy.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
OpenLDAP Public License

The OpenLDAP Public License
Version 2.8.1, 25 November 2003

Redistribution and use of this software and associated documentation
("Software"), with or without modification, are permitted provided
that the following conditions are met:

1. Redistributions in source form must retain copyright statements
and notices,

2. Redistributions in binary form must reproduce applicable copyright
statements and notices, this list of conditions, and the following
disclaimer in the documentation and/or other materials provided
with the distribution, and

3. Redistributions must contain a verbatim copy of this document.

The OpenLDAP Foundation may revise this license from time to time.
Each revision is distinguished by a version number. You may use
this Software under terms of this license revision or under the
terms of any subsequent revision of the license.

THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

The names of the authors and copyright holders must not be used in
advertising or otherwise to promote the sale, use or other dealing
in this Software without specific, written prior permission. Title
to copyright in this Software shall at all times remain with copyright
holders.

OpenLDAP is a registered trademark of the OpenLDAP Foundation.

Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
California, USA. All rights reserved. Permission to copy and
distribute verbatim copies of this document is granted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# contrib/slapd-modules/ppm/Makefile
# Copyright 2014 David Coutadeur, Paris. All Rights Reserved.
#

CC=gcc

# Path of OpenLDAP sources
OLDAP_SOURCES=../../..
# Where the ppm configuration file should be installed
CONFIG=/etc/openldap/ppm.conf
# Path of OpenLDAP installed libs, where the ppm library should be installed
LIBDIR=/usr/lib/openldap

OPT=-g -O2 -Wall -fpic \
-DCONFIG_FILE="\"$(CONFIG)\"" \
-DDEBUG

# Where to find the OpenLDAP headers.

LDAP_INC=-I$(OLDAP_SOURCES)/include \
-I$(OLDAP_SOURCES)/servers/slapd

# Where to find the OpenLDAP libraries.

LDAP_LIBS=-L$(OLDAP_SOURCES)/libraries/liblber/.libs \
-L$(OLDAP_SOURCES)/libraries/libldap_r/.libs

CRACK_INC=-DCRACKLIB

INCS=$(LDAP_INC) $(CRACK_INC)

LDAP_LIB=-lldap_r -llber

CRACK_LIB=-lcrack

LIBS=$(LDAP_LIB) $(CRACK_LIB)

TESTS=./unit_tests.sh



all: ppm ppm_test

ppm_test:
$(CC) -g $(LDAP_INC) $(LDAP_LIBS) -Wl,-rpath=. -o ppm_test ppm_test.c ppm.so $(LIBS)

ppm.o:
$(CC) $(OPT) -c $(INCS) ppm.c

ppm: ppm.o
$(CC) $(LDAP_INC) -shared -o ppm.so ppm.o $(CRACK_LIB)

install: ppm
cp -f ppm.so $(LIBDIR)
cp -f ppm_test $(LIBDIR)
cp -f ppm.conf $(CONFIG)

.PHONY: clean

clean:
$(RM) -f ppm.o ppm.so ppm.lo ppm_test
$(RM) -rf .libs

test: ppm ppm_test
$(TESTS)


Loading

0 comments on commit c55b12f

Please sign in to comment.