Re: Password modify

Brian Reichert <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
On Thu, Feb 17, 2011 at 11:10:46AM -0600, Robert Threet wrote:
> I have a working Net::LDAP::Entry program for adding users so I decided
> to gut it to create a userPassword changer.
> 
> I keep getting "Error changing password: no objectClass attribute".
> 
> I cannot find examples doing simple one-at-a-time adds like this.  All I
> can find are examples using arrays and hashes and cannot seem to
> translate it to this.  Any tips?
> 
>         my $macEntry = Net::LDAP::Entry->new;
>         $newdn="uid=" . $username . ",cn=people,dc=lib-mac,dc=local";
>         $macEntry->dn($newdn);
> 	# added sha1 hashing
>         $salt=XX;
>         $ctx = Digest::SHA1->new;
>         $ctx->add($newpw);
>         $ctx->add($salt);
>         $newMacpw = '{SSHA}' . encode_base64($ctx->digest . $salt ,'');
>         $macEntry->replace(userPassword => $newMacpw);
>         my $add = $macBind->add($macEntry);

Give it an object class, like 'person'?

What objectClasses do your extant users have?

> -- 
> Robert Threet
> Systems Manager
> USI Computer Center
> (812) 465-1082
> Confidentiality Statement: This email message, including any
> attachments, is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information.

-- 
Brian Reichert				<[email protected]>
55 Crystal Ave. #286			
Derry NH 03038-1725 USA			BSD admin/developer at large
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.