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

Re: Double colon in LDIF



rob fielding:
> 
> Hi,
> 
> I'm still finding my feet in LDAP and LDIFs but I've been led to think
> entries such as these were 'corruptions' :
> 
> cisSetting:: Ym0ubmV3QGRl
> userPassword:: eXZxZDJkbHk=
> dn:: AGNuPWRzdnIwMDAwLG91PUF

<snip>

> Can someone clarify whether the above is 'normal' or not? I'm begining
> to think they are encoded in some way, however why would gq render them
> in plaintext, yet slapcat and ldapsearch render them in this way? What
> does the double colon signify? Perhaps the NSD LDIF isn't as corrupt as
> we thought?

Double colon in LDIF like this means that the value is encoded with
base64. Run it through mimedecode or python's base64.decodestring(value)
and you'll see what the real value is. Inside the ldap-database, values
are utf8, and if you use LDAP API, you can use utf8 directly. But if you
use plain old LDIF, you must convert utf8 etc to base64 and state that
the following value is base64 encoded using double colon.

example -> 
description:: SGVsbG8gd29ybGQ=      which translates to
description: Hello world

This example is wrong usage though, since values with only us-ascii
doesn't have to be base64-encoded.

-- 
Regards
  
Bjørn Ove Grøtan