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

RE: FW: Net::LDAP



32 is object not found which probably means the parent for the object you are
trying to insert does not exist which makes sense.  You are doing:

$result = $ldap->add(\$entry);

which passes a reference to a reference ($entry is already a reference). The
Net::LDAP manpage says just pass $entry not a reference to it.

68 is object already exists so it sounds like that entry is already in ldap.
The code looks fine though.


On 01-Nov-99 mikema@crt.com wrote:
> 
> Jason,
> 
>       Sorry, I sent off the first mail before I was complete.
> 
> -Mike
>       
>> -----Original Message-----
>> From:        Mazzolini, Mike 
>> Sent:        Monday, November 01, 1999 3:39 PM
>> To:  'jbodnar@tivoli.com'
>> Subject:     RE: Net::LDAP
>> 
>> Jason,
>> 
>>      Thanks for responding.  Here is my sample code done 2 different
>> ways.
>> 
>> require 5.005;
>> 
>> use Net::LDAP;
>> use Net::LDAP::LDIF;
>> use strict;
>> 
>> my $result;
>> my $entry;
>> 
>> my $ldap = Net::LDAP->new("chissd01", debug => 3);
>> 
>> $result = $ldap->bind (
>>                              dn      => 'cn=root, ou=people, o=gcib',
>>                              password  => 'secret'
>>                      );
>> 
>> open (LDIF, "entry.ldif") || die "cannot open entry.ldif";
>> 
>> my $ldif = Net::LDAP::LDIF->new(\*LDIF,"r");
>> 
>> while ($entry = $ldif->read()) {
>> 
>> $result = $ldap->add(\$entry);
>>                              
>> $result->code && warn "failed to add entry: ", $result->error ;
>> printf "err: %s  %d\n", $result->error, $result->code;
>> }
>> 
>> 
>> Here is the same example without importing the LDIF file.
>> 
>       require 5.005;
> 
>       use Net::LDAP;
>       use Net::LDAP::LDIF;
> 
>       use strict;
> 
>       my $result;
>       my $entry;
>       my $ldap = Net::LDAP->new("chissd01", debug => 3);
> 
> 
>       $result = $ldap->bind (
>                                       dn              => 'cn=root,
> ou=people, o=gcib',
>                                       password  => 'secret'
>                               );
> 
>       $result = $ldap->add(
>                                                       dn              =>
> 'cn=joesho, ou=people, o=gcib',
>                                                       attr    => [cn =>
> 'joesho',
>       
> sn  => 'Shoes',
>       
> givenname => 'Joey Shoes',
>       
> uid => '9999',
>       
> objectclass => 'person',
>       
> objectclass => [qw('top', 'person', 'organizationPerson', 'inetOrgPerson')],
>       
> objectclass => 'person',
>       
> objectclass => 'organizationalPerson',
>       
> objectclass => 'inetOrgPerson'
>                                                                          ]
>                                               );
> 
>       $result = $ldap->add(\$entry);
>                                       
>       $result->code && warn "failed to add entry: ", $result->error ;
>       printf "err: %s  %d\n", $result->error, $result->code;
>       }
>        
> 
>       I believe I'm getting error #32 on the first example and #68 on the
> second.
> 
>       Thanks for your help,
> 
>       - Mike 
> 
> 
>>   
>> -----Original Message-----
>> From:        Jason Bodnar [SMTP:jbodnar@tivoli.com]
>> Sent:        Monday, November 01, 1999 3:29 PM
>> To:  mikema@crt.com
>> Cc:  openldap-software@OpenLDAP.org
>> Subject:     RE: Net::LDAP
>> 
>> I'm using it without a problem. Maybe if you post some sample code we can
>> find
>> your problem. What error code are you getting?
>> 
>> On 01-Nov-99 mikema@crt.com wrote:
>> > 
>> > All,
>> > 
>> >       Has anyone been successful using the Net::LDAP module in perl.  It
>> > seems to fail anytime I try and add.  I can search with no problem.  
>> > 
>> > Thanks,
>> > 
>> >> _______
>> >> 
>> >> Mike Mazzolini
>> >> Bank Of America
>> >> 
>> >> - Whether you think you can or think you can't, you're right!
>> >> 
>> >> 
>> 
>> ---
>> Jason Bodnar + jbodnar@tivoli.com + Tivoli Systems
>> 
>> Shelfware: The art of practicing one's skill to perfection without an
>> audience
>> to appreciate it. -- Michelle Dear

---
Jason Bodnar + jbodnar@tivoli.com + Tivoli Systems

I swear I'd forget my own head if it wasn't up my ass. -- Jason Bodnar