[Freeipa-users] Ldapsearch with a trailing space

Rich Megginson rmeggins at redhat.com
Thu Aug 21 00:32:26 UTC 2014


On 08/20/2014 05:28 PM, William wrote:
>> How did you manage to add an attribute value with a trailing space?
>>
> Excellent question: Someone else in my workplace managed to stuff this
> one up, so that a users objectClass has a trailing space, thus is
> returning is base64 on search now.

Ok.  As to how to fix it:
ldapsearch -xLLL -D "cn=directory manager" -W -s base -b "the dn with 
the broken objectclass" 'objectclass=*' objectclass > junk.ldif

then edit junk.ldif to look like this:

dn: the dn with the broken objectclass
changetype: modify
replace: objectclass
objectclass: ....
objectclass: ....


Basically, all of the objectclasses from ldapsearch, but fixing the one 
with the trailing space

Then use ldapmodify

ldapmodify -x -D "cn=directory manager" -W -f junk.ldif

As to your original question - I'm not sure - I would have thought the 
correct way to do it would have been to use the ldap escape sequence for 
space in the ldap search filter.




More information about the Freeipa-users mailing list