[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldapmodify: multiple additions



Following RFC2849 (LDIF), it seems the multiple attributes on a single line isn't supported.


mod-spec         = ("add:" / "delete:" / "replace:")
             ÂFILL AttributeDescription SEP
             Â*attrval-spec
             Â"-" SEP

AttributeDescription   = AttributeType [";" options]

AttributeType      Â= ldap-oid / (ALPHA *(attr-type-chars))

attrval-spec       = AttributeDescription value-spec SEP

value-spec        = ":" (  ÂFILL 0*1(SAFE-STRING) /
                ":" FILL (BASE64-STRING) /
                "<" FILL url)

FILL Â Â Â Â Â Â Â Â Â Â = *SPACE

SEP Â Â Â Â Â Â Â Â Â Â Â= (CR LF / LF)


2013/3/13 infirit <infirit@gmail.com>
Hi, I am working through a book (Mastering OpenLDAP, Packtpub) which is
based on openldap 2.3.

The book talks in chapter 3 how to modify/add/delete attributes for a
dn. It instructs to put the bellow in an ldif file and read it with
ldapmodify. The writerÅ point here is that I am supposed to add both a
"description" and "title" without separating out the additions with a
dash (-).

It never works for me and always comes with a syntax error.

non working ldif file:
dn: uid=nicholas,ou=Users,dc=home
changetype: modify
add: description title # <- 2 attributes
description: This is a test
title: Cartesian philosopher

Error: ldapmodify: wrong attributeType at line 4, entry
"uid=nicholas,ou=Users,dc=home"

The ldif file that does work is below.

Working ldif file:
dn: uid=nicholas,ou=Users,dc=home
changetype: modify
add: description
description: This is a test
-
add: title
title: Cartesian philosopher

Now am I doing something wrong, is the book using functionality that is
not available in openldap version 2.4 or something else?

Any pointers and help much appreciated.

Thx
infirit


--
Erwann.