LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Ldap error: (https://www.linuxquestions.org/questions/linux-networking-3/ldap-error-604613/)

aravindhcl 12-05-2007 01:54 AM

Ldap error:
 
when am trying to add LDIF files to the database, am getting this error.


[root@server ~]# ldapadd -x -D "cn=Manager,dc=example,dc=com" \
> -W -f /etc/openldap/example.com.ldif
Enter LDAP Password:
adding new entry "dc=example,dc=com"
ldap_add: Undefined attribute type (17)
additional info: decription: attribute type undefined

I cant able to add the LDIF file.
Totally am having 3 LDIF files,
1)example.com.ldif
2)ldapusers.ldif
3)root.ldif



In my slapd.conf file i have added the slappasswd as below which
i mention in dark letters.Is it correct?
I had just given slappasswd in my prompt and type the new password
and retype password.It automatically encrypt that password.
I copied that password and given in slapd.conf



This is my slapd.conf file.
===========================================

# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw {SSHA}E3+Pe58NVPdZY1VOePmlvvsjDAkRjnEC
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw secret
# rootpw {crypt}ijFYNcSNctBYg

# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap/example.com

# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM


database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw {SSHA}E3+Pe58NVPdZY1VOePmlvvsjDAkRjnEC

aravindhcl 12-05-2007 01:56 AM

when i give Ldapsearch command i getting the following error.

[root@server ~]# ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope sub
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1
[root@server ~]#

bathory 12-05-2007 04:38 AM

2 things I've noticed:
Quote:

database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
rootpw {SSHA}E3+Pe58NVPdZY1VOePmlvvsjDAkRjnEC
Is the above snippet included 2 times in your slapd.conf, or it's just a copy/paste error? It should exists only once.
2nd: There are no schema files included in your slapd.conf. Objectclasses are defined inside the various schema files (usually under /etc/openldap/schema).
Also you didn't post the ldif files you're trying to add, so we can have a better look in your prob.

aravindhcl 12-05-2007 05:25 AM

the first one was the copying error.

Here is the LDIF file which i try to add.

[root@server openldap]# cat example.com.ldif
dn: dc=example,dc=com
dc: example
description: Root LDAP entry for example.com
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject

dn: ou=People, dc=example,dc=com
ou: People
description: All people in organisation
objectClass: organizationalUnit
[root@server openldap]#


here is slapd file.
schema file is also there.[root@server openldap]# cat slapd.conf
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema

# Allow LDAPv2 client connections. This is NOT the default.
allow bind_v2

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args

# Load dynamic backend modules:
# modulepath /usr/sbin/openldap
# moduleload back_bdb.la
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la

# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /usr/share/ssl/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it. Your client software
# may balk at self-signed certificates, however.
# TLSCACertificateFile /usr/share/ssl/certs/ca-bundle.crt
# TLSCertificateFile /usr/share/ssl/certs/slapd.pem
# TLSCertificateKeyFile /usr/share/ssl/certs/slapd.pem

# 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!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database bdb
suffix "dc=example,dc=com"
rootdn "cn=Manager,dc=example,dc=com"
#rootpw {SSHA}E3+Pe58NVPdZY1VOePmlvvsjDAkRjnEC
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {SSHA}9+PB01CrKc/w1oCejdgnSIpq+m1Whyfv
# rootpw {crypt}ijFYNcSNctBYg

# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap/example.com

# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM

it was also copying error.

bathory 12-05-2007 07:51 AM

Given the example.com.ldif you're trying to import and the error you get:
Quote:

ldap_add: Undefined attribute type (17)
additional info: decription: attribute type undefined
it seems it cannot find the decription attribute (typo?). I cannot see any typo in your ldif file. Perhaps you should look better your ldif for typos, or you can remove the lines with the "description" attribute to see if you can add the ldif into the server.

aravindhcl 12-05-2007 08:52 AM

Still geting the same error.

bathory 12-06-2007 06:42 AM

FYI, I've used your slapd.conf and example.com.ldif in my slapd server (version 2.4.6) and everything worked fine.
If I change "description: Root LDAP entry for example.com" to "decription: Root LDAP entry for example.com", then I get the same error as you do. So double-check the ldif, or better yet rewrite it from scratch using vi.
Or you can use slapadd (with slapd server stopped) to add the ldif:
Code:

slapadd -l example.com.ldif


All times are GMT -5. The time now is 09:31 PM.