From: Jonathon P. <jpa...@ho...> - 2002-09-27 02:03:29
|
I'm new to Net::LDAP and trying to do a basic insert. I've taken the data from an ldif file, converted it into a hash, and trying to insert, unsuccessfully. The data can be inserted via ldiff/ldapadd fine though. The error given is: Failed to add entry: addRequest.addRequest.objectName is undefined at /usr/lib/perl5/site_perl/5.6.1/Net/LDAP/Message.pm line 163 I've tried looking at the code which the error refers to, but I don't understand it. I've followed the example in the docs, creating a Net::LDAP object, and then a Net::LDAP::Entry object. my $ldap = Net::LDAP->new('localhost') or die "$@"; $ldap->bind(base => 'cn=xxxxx,dc=hotkey,dc=net,dc=au', password => 'xxxxx') or die "$@"; The Net::LDAP::Entry object gets created, and filled with this date (printed via Data::Dumper) $VAR1 = bless( { 'asn' => { 'attributes' => [ { 'vals' => [ 'Peter XX' ], 'type' => 'gecos' }, { 'vals' => [ 'VIC' ], 'type' => 'st' }, { 'vals' => [ 'xx...@ho...' ], 'type' => 'mail' }, { 'vals' => [ 'Unknown' ], 'type' => 'facsimiletelephonenumber' }, { 'vals' => [ 'Peter XX' ], 'type' => 'displayname' }, { 'vals' => [ 'top', 'person', 'posixAccount', 'account', 'organizationalPerson', 'inetOrgPerson', 'officePerson', 'zillaPerson' ], 'type' => 'objectclass' }, { 'vals' => [ 'AU' ], 'type' => 'c' }, { 'vals' => [ 'Unknown' ], 'type' => 'telephonenumber' }, { 'vals' => [ 'Unknown' ], 'type' => 'mobile' }, { 'vals' => [ 'Rye' ], 'type' => 'l' }, { 'vals' => [ '231' ], 'type' => 'uidnumber' }, { 'vals' => [ 'hotkey' ], 'type' => 'o' }, { 'vals' => [ '116' ], 'type' => 'gidnumber' }, { 'vals' => [ '{crypt}xxx' ], 'type' => 'userpassword' }, { 'vals' => [ '68 xxxx Rd' ], 'type' => 'postaladdress' }, { 'vals' => [ '3000' ], 'type' => 'postalcode' }, { 'vals' => [ '5985 xxxx' ], 'type' => 'homephone' }, { 'vals' => [ '/dev/null' ], 'type' => 'homedirectory' }, { 'vals' => [ 'User', 'Hotkey Peninsula' ], 'type' => 'ou' }, { 'vals' => [ 'Peter xxx' ], 'type' => 'cn' }, { 'vals' => [ 'Davis' ], 'type' => 'sn' }, { 'vals' => [ 'Peter' ], 'type' => 'givenname' }, { 'vals' => [ '/bin/false' ], 'type' => 'loginshell' }, { 'vals' => [ 'uidNumber=231,ou=User,o=hotkey' ], 'type' => 'dn' }, { 'vals' => [ 'Hotkey Peninsula' ], 'type' => 'departmentnumber' }, { 'vals' => [ 'pdavis' ], 'type' => 'uid' } ] }, 'attrs' => { 'st' => $VAR1->{'asn'}{'attributes'}[1]{'vals'}, 'gecos' => $VAR1->{'asn'}{'attributes'}[0]{'vals'}, 'mail' => $VAR1->{'asn'}{'attributes'}[2]{'vals'}, 'c' => $VAR1->{'asn'}{'attributes'}[6]{'vals'}, 'displayname' => $VAR1->{'asn'}{'attributes'}[4]{'vals'}, 'objectclass' => $VAR1->{'asn'}{'attributes'}[5]{'vals'}, 'facsimiletelephonenumber' => $VAR1->{'asn'}{'attributes'}[3]{'vals'}, 'telephonenumber' => $VAR1->{'asn'}{'attributes'}[7]{'vals'}, 'mobile' => $VAR1->{'asn'}{'attributes'}[8]{'vals'}, 'l' => $VAR1->{'asn'}{'attributes'}[9]{'vals'}, 'uidnumber' => $VAR1->{'asn'}{'attributes'}[10]{'vals'}, 'o' => $VAR1->{'asn'}{'attributes'}[11]{'vals'}, 'gidnumber' => $VAR1->{'asn'}{'attributes'}[12]{'vals'}, 'userpassword' => $VAR1->{'asn'}{'attributes'}[13]{'vals'}, 'postaladdress' => $VAR1->{'asn'}{'attributes'}[14]{'vals'}, 'postalcode' => $VAR1->{'asn'}{'attributes'}[15]{'vals'}, 'homephone' => $VAR1->{'asn'}{'attributes'}[16]{'vals'}, 'homedirectory' => $VAR1->{'asn'}{'attributes'}[17]{'vals'}, 'cn' => $VAR1->{'asn'}{'attributes'}[19]{'vals'}, 'ou' => $VAR1->{'asn'}{'attributes'}[18]{'vals'}, 'sn' => $VAR1->{'asn'}{'attributes'}[20]{'vals'}, 'dn' => $VAR1->{'asn'}{'attributes'}[23]{'vals'}, 'givenname' => $VAR1->{'asn'}{'attributes'}[21]{'vals'}, 'loginshell' => $VAR1->{'asn'}{'attributes'}[22]{'vals'}, 'uid' => $VAR1->{'asn'}{'attributes'}[25]{'vals'}, 'departmentnumber' => $VAR1->{'asn'}{'attributes'}[24]{'vals'} }, 'changes' => [], 'changetype' => 'add' }, 'Net::LDAP::Entry' ); Failed to add entry: addRequest.addRequest.objectName is undefined at /usr/lib/perl5/site_perl/5.6.1/Net/LDAP/Message.pm line 163 perl -V gives: Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=linux, osvers=2.4.17-0.13smp, archname=i386-linux uname='linux daffy.perf.redhat.com 2.4.17-0.13smp #1 smp fri feb 1 10:30:48 est 2002 i686 unknown ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include', optimize='-O2 -march=i386 -mcpu=i686', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.2 2.96-109)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: Built under linux Compiled at Apr 1 2002 12:23:22 @INC: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl I've checked the docs, searched the web and this list, but havn't found anything relevant. Any hits would be appreciated, Regards, Jonathon Padfield |