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

Re: ldapmodify



It is still not working.  I tried it both of the ways you have, with and 
without the -a.  Here is my LDIF with the -a:

dn: cn=Joe Schmo,ou=people,dc=mydomain,dc=com
changetype: modify
add: objectclass
objectClass: posixAccount
-
replace: uid
uid: angel
-
replace: userPassword
userPassword: {crypt}7FZxyiS7L2E9I


And here is my ldapmodify command:
baa:/etc/openldap # ldapmodify -D "cn=Manager,dc=mydomain,dc=com" -W -x -a -f 
schmo.ldif
Enter LDAP Password:
ldapmodify: invalid format (line 8) entry: "cn=Joe 
Schmo,ou=people,dc=mydomain,dc=com"

I'm sorry to bother you guys, I am sure that this is such a newbie question, 
but I just don't get what I'm doing wrong. :(


On Monday 16 August 2004 06:44, Peter Marschall wrote:
> Hi,
>
> please stay on the list !
>
> On Saturday 14 August 2004 00:04, Misty Stanley-Jones wrote:
> > The entries at the end are not replacements but simple adds.
>
> They aren't entries but attributes of an entry that get updated.
>
> The fact that you add the objectclass containing these attributes tells
> that these attributes aren't present in the entry.
> Using replace instead of add does no harm here since replace changes all
> values of the attribute to those listed in the LDIF file.
>
> > Is it true
> > that if I use ldapmodify with -a switch, it will try to add them unless
> > there is another directive?
>
> AFAICT yes but you need to have ha plain LDIF file without the
> changetype: line. In this case the option -a for ldapmodify adds
> the attribute values instead of replacing them
>
> I.e. without -a the entry
>
>   dn: cn=Joe Schmo,ou=people,dc=mydomain,dc=com
>   uid: joe
>   userPassword: {crypt}7FZxyiS7L2E9I
>
> is equivalent to
>
>   dn: cn=Joe Schmo,ou=people,dc=mydomain,dc=com
>   changetype: modify
>   replace: uid
>   uid: joe
>   -
>   replace: userPassword
>   userPassword: {crypt}7FZxyiS7L2E9I
>
> while with -a it is equivalent to
>
>   dn: cn=Joe Schmo,ou=people,dc=mydomain,dc=com
>   changetype: modify
>   add: uid
>   uid: joe
>   -
>   add: userPassword
>   userPassword: {crypt}7FZxyiS7L2E9I
>
> Peter