[OpenLDAP] Impossible d'ajouter des personnes dans un répertoire LDAP
Bonjour,
Je souhaite installer un serveur OpenLDAP, juste pour faire des tests SSO avec lemonLDAP.
Donc j'ai installé openldap en version 2.4.12, et berkeleyDB 4.7.25.
Je travaille directement sur la machine, sans passer par le réseau, et j'ai suivi les instructions ici pour installer et initialiser le répertoire LDAP.
Le fichier slapd.conf :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/etc/openldap/schema/core.schema
# Define global ACLs to disable default read access.
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /usr/local/var/run/slapd.pid
argsfile /usr/local/var/run/slapd.args
# Load dynamic backend modules:
# modulepath /usr/local/libexec/openldap
# moduleload back_bdb.la
# moduleload back_hdb.la
# moduleload back_ldap.la
# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64
# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
#######################################################################
# BDB database definitions
#######################################################################
database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /usr/local/var/openldap-data
# Indices to maintain
index objectClass eq |
Pour initialiser mon répertoire, j'ai créé le fichier :
Code:
1 2 3 4 5 6 7 8 9 10
|
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager |
puis j'ai utiliser la commande :
Code:
1 2
|
/usr/local/bin/ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f ajout1.ldif |
Jusque la tout va bien. Si je fais :
Code:
1 2
|
/usr/local/bin/ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)' |
j'obtien :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# example.com
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
o: Example Company
dc: example
# Manager, example.com
dn: cn=Manager,dc=example,dc=com
objectClass: organizationalRole
cn: Manager
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2 |
Si après cela, je crée le fichier :
Code:
1 2 3 4 5 6
|
dn: cn=Tony GALMICHE,dc=example,dc=com
objectClass: dcObject
cn: Tony GALMICHE
givenName: Tony
sn: GALMICHE |
et que je lance la commande :
Code:
1 2
|
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f ajout2.ldif |
J'obtiens :
Code:
1 2
|
adding new entry "cn=Tony GALMICHE,dc=example,dc=com" |
puis plus rien. ldapadd ne retourne pas, et je peux attendre 20 minutes sans que le processus ldapadd ne se termine.
Si je fait un control C, puis un :
Code:
1 2
|
/usr/local/bin/ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)' |
J'obtiens :
Code:
1 2 3 4 5 6 7 8
|
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
# |
Et la aussi il ne me rend pas la main.
Je suis obligé de tuer le processus et de le relancer pour que la commande ldapsearch fonctionne correctement.
Je ne sais pas si le problème vient de ma configuration, du fichier ldif, ou si c'est un bug de la dernière version stable de OpenLDAP.