From: Roland S. <rol...@ep...> - 2001-04-23 10:26:00
|
Hi, another one: I'm trying to modify: this works: ----- $mesg = $ldap->modify("cn=onemore,o=epigenomics", replace => {'sn' => 'Jackson'}); print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; ----- but this way (another documented way for performing that): ----- # ... binding ... $entry = Net::LDAP::Entry->new; $entry->dn("cn=onemore,o=epigenomics"); $entry->replace("sn" => "Jackson"); $mesg=$ldap->modify($entry); print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; ----- ... the server isn't updated correctly: ----- Net::LDAP=HASH(0x80f1538) sending: 30 26 02 01 01 60 21 02 01 03 04 16 63 6E 3D 61 0&...`!.....cn=a 64 6D 69 6E 2C 6F 3D 65 70 69 67 65 6E 6F 6D 69 dmin,o=epigenomi 63 73 80 04 6D 79 70 77 __ __ __ __ __ __ __ __ cs..mypw 0000 30 38: SEQUENCE { 0002 02 1: INTEGER = 1 0005 60 33: [APPLICATION 0] { 0007 02 1: INTEGER = 3 000A 04 22: STRING = 'cn=admin,o=epigenomics' 0022 80 4: [CONTEXT 0] 0024 : 6D 79 70 77 __ __ __ __ __ __ __ __ __ __ __ __ mypw 0028 : } 0028 : } Net::LDAP=HASH(0x80f1538) received: 30 0C 02 01 01 61 07 0A 01 00 04 00 04 00 __ __ 0....a........ 0000 30 12: SEQUENCE { 0002 02 1: INTEGER = 1 0005 61 7: [APPLICATION 1] { 0007 0A 1: ENUM = 0 000A 04 0: STRING = '' 000C 04 0: STRING = '' 000E : } 000E : } Net::LDAP=HASH(0x80f1538) sending: 30 21 02 01 02 66 1C 04 18 63 6E 3D 6F 6E 65 6D 0!...f...cn=onem 6F 72 65 2C 6F 3D 65 70 69 67 65 6E 6F 6D 69 63 ore,o=epigenomic 73 30 00 __ __ __ __ __ __ __ __ __ __ __ __ __ s0. 0000 30 33: SEQUENCE { 0002 02 1: INTEGER = 2 0005 66 28: [APPLICATION 6] { 0007 04 24: STRING = 'cn=onemore,o=epigenomics' 0021 30 0: SEQUENCE { 0023 : } 0023 : } 0023 : } Net::LDAP=HASH(0x80f1538) received: 30 0C 02 01 02 67 07 0A 01 00 04 00 04 00 __ __ 0....g........ 0000 30 12: SEQUENCE { 0002 02 1: INTEGER = 2 0005 67 7: [APPLICATION 7] { 0007 0A 1: ENUM = 0 000A 04 0: STRING = '' 000C 04 0: STRING = '' 000E : } 000E : } Net::LDAP=HASH(0x80f1538) sending: 30 05 02 01 03 42 00 __ __ __ __ __ __ __ __ __ 0....B. 0000 30 5: SEQUENCE { 0002 02 1: INTEGER = 3 0005 42 0: [APPLICATION 2] 0007 : } Bind result: 0, Message: Success LDAP Version: 3 modifying... code: 0 error: Success ----- But: Adding a new user works this way. (using perl-ldap 0.22) Thanks! bye, -- Roland Stigge Epigenomics AG Kastanienallee 24 www.epigenomics.com 10435 Berlin |
From: Graham B. <gb...@po...> - 2001-04-23 11:29:48
|
On Mon, Apr 23, 2001 at 12:01:22PM +0200, Roland Stigge wrote: > Hi, > > another one: > > I'm trying to modify: > > this works: > ----- > $mesg = $ldap->modify("cn=onemore,o=epigenomics", > replace => {'sn' => 'Jackson'}); > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > ----- > > but this way (another documented way for performing that): > ----- > # ... binding ... > > $entry = Net::LDAP::Entry->new; > $entry->dn("cn=onemore,o=epigenomics"); > $entry->replace("sn" => "Jackson"); > $mesg=$ldap->modify($entry); > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > ----- > > But: Adding a new user works this way. > > (using perl-ldap 0.22) Can you please try with 0.23 I seem to remember some bug fixes in this area. Graham. |
From: Roland S. <rol...@ep...> - 2001-04-23 12:56:27
|
Graham Barr wrote: > > On Mon, Apr 23, 2001 at 12:01:22PM +0200, Roland Stigge wrote: > > Hi, > > > > another one: > > > > I'm trying to modify: > > > > this works: > > ----- > > $mesg = $ldap->modify("cn=onemore,o=epigenomics", > > replace => {'sn' => 'Jackson'}); > > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > > ----- > > > > but this way (another documented way for performing that): > > ----- > > # ... binding ... > > > > $entry = Net::LDAP::Entry->new; > > $entry->dn("cn=onemore,o=epigenomics"); > > $entry->replace("sn" => "Jackson"); > > $mesg=$ldap->modify($entry); > > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > > ----- > > > > > But: Adding a new user works this way. > > > > (using perl-ldap 0.22) > > Can you please try with 0.23 > > I seem to remember some bug fixes in this area. Same problem. bye, -- Roland Stigge Epigenomics AG Kastanienallee 24 www.epigenomics.com 10435 Berlin |
From: Graham B. <gb...@po...> - 2001-04-23 18:05:20
|
On Mon, Apr 23, 2001 at 12:01:22PM +0200, Roland Stigge wrote: > Hi, > > another one: > > I'm trying to modify: > > this works: > ----- > $mesg = $ldap->modify("cn=onemore,o=epigenomics", > replace => {'sn' => 'Jackson'}); > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > ----- > > but this way (another documented way for performing that): > ----- > # ... binding ... > > $entry = Net::LDAP::Entry->new; > $entry->dn("cn=onemore,o=epigenomics"); > $entry->replace("sn" => "Jackson"); > $mesg=$ldap->modify($entry); > print "code: ",$mesg->code,"\nerror: ",$mesg->error,"\n"; > ----- Actually the docs are bit ambigious here. But I would say that this is not documented to work as you expect here. Although what should work, and is documented is $entry->update($ldap); The docs should clarify that if an Entry is passed as the DN only the DN is extracted from it. This is the same for ant Net::LDAP method. Graham. |