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

Inserting userPassword attribute programatically

I'm running OpenLDAP 2.1.25.  I'm creating several entries
programatically using Net::LDAP for perl.  Does anyone know how I should
be adding the userPassword attribute?

I try to just add the plain password string like the code snippet below
and all the entries add fine but I end up with no value for the
userPassword attribute for each entry.  Do I need to convert to a
different data type before adding?  Any assistance would be great.


my $userentry = Net::LDAP::Entry->new() or die "some message";
$userentry->add("userPassword" => $userpassword);
my $mesg = $ldap->add($userentry);
if ($mesg->code)
	printf "\nsome other error message " . $mesg->error;

My core.schema shows this:

# system schema
#attributetype ( NAME 'userPassword'
#       DESC 'RFC2256/2307: password of user'
#       EQUALITY octetStringMatch
#       SYNTAX{128} )