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

ldapmodify (and ldapadd) fails



Good evening all.

I have a scenario where I do need to add and modify some attributes after the initial creation of an entry.

tkelev:~/ldap # ldapmodify -D "cn=Manager,dc=tysvernett,dc=no" -W -v -x -f mod2
ldap_initialize( <DEFAULT> )
add sn:
Etternavn
adding new entry "uid=test10,ou=People,dc=tysvernett,dc=no"
modify complete
ldap_add: Already exists (68)
additional info: ¸ßØU©@


This seems like gibberish to me.


The file mod2 looks like this: dn: uid=test10,ou=People,dc=tysvernett,dc=no changeType: add sn: Etternavn

-

changeType: add
givenName: Fornavn

-

changeType: modify
replace: cn
cn: Fornavn Etternavn

-

changeType: add
mail: test10@tysvernett.no


Why this does not work seems like a mystery to me. None of the added attributes already exists,
so I can't understand why i get the "Already exists".



Plan B: Exporting the entry to a ldif, altering the ldif and then importing.

ldapsearch -x "(uid=test10)" -LLL > /tmp/user.ldif

I then append the missing entries to the end of the ldif using cat:
cat >> /tmp/user.ldif
gecos: Test10
mail: test10@tysvernett.no
givenName: Test10
sn: Test10

When adding, everything seems to work fine

ldapadd -D "cn=Manager,dc=tysvernett,dc=no" -W -v -x -f /tmp/user.ldif

adding new entry "uid=test10,ou=People,dc=tysvernett,dc=no"
[...]
modify complete
ldap_add: Already exists (68)
       additional info: ¨ãØuÙ@

I get the exact same error. What does this "additional info" mean? What about these characters?
To me it looks like gibberish. Are there maybe problems with charsets?


# file /tmp/user.ldif
/tmp/user.ldif: ASCII text

Plan C:

Perl and Net::LDAP?

By the way, the original ldif of user test10 looks like this:
dn: uid=test10,ou=People,dc=tysvernett,dc=no
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
uid: test10
uidNumber: 1349
homeDirectory: /home/test10
loginShell: /sbin/nologin
sambaSID: S-1-5-21-2149826953-2850835393-1128187768-3698
sambaPrimaryGroupSID: S-1-5-21-2149826953-2850835393-1128187768-1201
displayName: test10
sambaPwdMustChange: 2147483647
sambaLMPassword: FE12086CE1A36EF5AAD3B435B51404EE
sambaNTPassword: 314040DC01195C391E161E6B39824C78
sambaPasswordHistory: 00000000000000000000000000000000000000000000000000000000
00000000
sambaAcctFlags: [U ]
sambaPwdCanChange: 1105226118
sambaPwdLastSet: 1105226118
gidNumber: 513


Any help are most appreciatet.
Cheers
Rolf