Message from discussion
Password modify
Newsgroups: perl.ldap
Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!nntp.develooper.com!nntp.perl.org
Return-Path: <reich...@numachi.com>
Mailing-List: contact perl-ldap-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl-l...@perl.org
Received: (qmail 15123 invoked from network); 18 Feb 2011 16:42:42 -0000
Received: from x1.develooper.com (207.171.7.70)
by x6.develooper.com with SMTP; 18 Feb 2011 16:42:42 -0000
Received: (qmail 20760 invoked by uid 225); 18 Feb 2011 16:42:42 -0000
Delivered-To: perl-l...@perl.org
Received: (qmail 20756 invoked by alias); 18 Feb 2011 16:42:42 -0000
X-Spam-Status: No, hits=-0.0 required=8.0
tests=RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD
X-Spam-Check-By: la.mx.develooper.com
Received: from meisai.numachi.com (HELO meisai.numachi.com) (198.175.254.6)
by la.mx.develooper.com (qpsmtpd/0.28) with SMTP; Fri, 18 Feb 2011 08:42:39 -0800
Received: (qmail 57355 invoked by uid 1001); 18 Feb 2011 16:42:32 -0000
Date: Fri, 18 Feb 2011 11:42:32 -0500
To: Robert Threet <rthr...@usi.edu>
Cc: perl-l...@perl.org
Subject: Re: Password modify
Message-ID: <20110218164232.GZ36025@numachi.com>
References: <4B96B7EE.1040804@ias.edu> <91CF0780-9A2A-4B84-9799-7A7765665D0D@pobox.com> <4B96E0F7.6070209@ias.edu> <D9814C6E-3636-470E-A8FE-18D084DD1BC1@pobox.com> <4D5D5696.6070707@usi.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4D5D5696.6070707@usi.edu>
User-Agent: Mutt/1.5.9i
Approved: n...@nntp.perl.org
From: reich...@numachi.com (Brian Reichert)
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 <reich...@numachi.com>
55 Crystal Ave. #286
Derry NH 03038-1725 USA BSD admin/developer at large