From: <Nor...@av...> - 2002-10-25 14:45:42
|
Hi Martin, > i want to add an attribute to an entry. The attribute should=20 > be visible and > encode the content like the given attribute userPassword. > I've created an attribute called initpw with the same=20 > definition as the > attribute userPassword. The syntax is 'binary octet'. The Syntax of "userPassword" is "octet string". > I try to add content to the attribute initpw with the code line: >=20 > $ldap->modify( $dnldap, add =3D> { initpw =3D> $ipw }) >=20 > When I take a look at the directory i alway see the attribute=20 > encoded in > cleartext it neither hashed nor binary format. My questions are > How can i tell the modify method to give an binary attribute=20 > to the LDAP ? Some servers, e.g. Netscape, automatically apply a hash function when = values of the "userPassword" attribute are added or modified. Strictly = speaking this behavior does not conform to the X.500 information model. = Normally a=20 server returns the same data you store to it, whether it is a pure ASCII = string or arbitrary data.=20 What you see as "binary" data is probably the Base64 encoding of the = hashed password. For your custom attribute "initpw", you'll have to hash = the password string yourself and then store the result to the LDAP = server. =20 Mit freundlichen Gr=FC=DFen / Best Regards Norbert Klasen Avinci - The Know-How Company http://www.avinci.biz |