You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(200) |
Jun
(129) |
Jul
(184) |
Aug
(204) |
Sep
(106) |
Oct
(79) |
Nov
(72) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(83) |
Feb
(123) |
Mar
(84) |
Apr
(184) |
May
(106) |
Jun
(111) |
Jul
(104) |
Aug
(91) |
Sep
(59) |
Oct
(99) |
Nov
(100) |
Dec
(37) |
2002 |
Jan
(148) |
Feb
(88) |
Mar
(85) |
Apr
(151) |
May
(80) |
Jun
(110) |
Jul
(85) |
Aug
(43) |
Sep
(64) |
Oct
(89) |
Nov
(59) |
Dec
(42) |
2003 |
Jan
(129) |
Feb
(104) |
Mar
(162) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Graham B. <gb...@po...> - 2000-07-03 16:14:13
|
It's OK I found it in the RFC, doh. The cookie returned in the controls will be empty. I think this just all shows that the API for controls is not yet optimal and needs some work. THis is something I would like to discuss at the perl conference. Graham. On Mon, Jul 03, 2000 at 10:26:53AM -0500, Mark Wilcox wrote: > > sorry I don't. I couldn't find anything on the IETF site as well. I wonder > if it's buried in a MS document somewhere, hidden by an NDA :). > > But I > did remember another argument for not including the paged-control in the > search method, it's a proprietary control for Active Directory (this > is perfectly legal LDAP, however ;). It will be > replaced by the Virtual List View control in future versions of AD, > because VLV provides everything Page control does, but it's being agreed > upon by Netscape, Microsoft and Novell, thus should be more standardized > across the board (I know Netscape already supports it, I think Novell > does). > > Mark > > On Mon, 3 Jul 2000, Graham Barr wrote: > > > Does anyone know when a Paged search is complete ? > > > > ----- Forwarded message from "Allen, Robbie" <ra...@ci...> ----- > > > > From: "Allen, Robbie" <ra...@ci...> > > To: "'Graham Barr'" <gb...@po...> > > Subject: RE: Page or VLV control > > Date: Sun, 2 Jul 2000 12:49:13 -0700 > > X-Mailer: Internet Mail Service (5.5.2650.21) > > > > Yep, that's better. So here is the finished product that works for me: > > > > #----------------------------------------------------# > > use Net::LDAP; > > use Net::LDAP::Control; > > use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED LDAP_CONTROL_SORTREQUEST > > ); > > > > ... > > > > $page = Net::LDAP::Control->new( LDAP_CONTROL_PAGED, size => 1000); > > $sort = Net::LDAP::Control->new( LDAP_CONTROL_SORTREQUEST, order => > > 'cn'); > > @args = ( base => "cn=subnets,cn=sites,cn=configuration,$BASE_DN", > > scope => "subtree", > > filter => "(objectClass=subnet)", > > control => [ $sort, $page ] ); > > while (($mesg = $LDAP->search( @args ))) { > > print_subnet($_) foreach $mesg->entries; > > last if $mesg->count < $page->size; > > ($resp) = $mesg->control( LDAP_CONTROL_PAGED ); > > $page->cookie($resp->cookie); > > } > > #----------------------------------------------------# > > > > The only question that still remains for me is the best way to determine > > a Paged search is complete. Above I just check to see if the mesg count > > is less than the page size, but seems like there should be a more > > intuitive approach. The search inside the while clause isn't a good > > check, because after the search completes, it starts over again from 1 > > (and continues), so the only way to break out of the loop is with the > > 'last' call. > > > > Thanks for working on this!!! This is the critical piece I was missing > > to start automating a lot of our Active Directory processes. > > > > Robbie Allen > > > > > > > -----Original Message----- > > > From: Graham Barr [mailto:gb...@po...] > > > Sent: Sunday, July 02, 2000 12:01 AM > > > To: Allen, Robbie > > > Subject: Re: Page or VLV control > > > > > > > > > Ah, OK. Try this new patch > > > > > > Graham. > > > > > > On Sat, Jul 01, 2000 at 08:32:35PM -0700, Allen, Robbie wrote: > > > > Works! At least for Paged and Sort, haven't tried VLV yet. > > > For some > > > > reason, when I used both Paged and Sort together, I also > > > had to 'use' > > > > SortResult.pm or else it complained that it couldn't find init: > > > > > > > > Can't locate object method "init" via package > > > > "Net::LDAP::Control::SortResult" a > > > > t /usr/SD/perl5.004_05/lib/site_perl/Net/LDAP/Control.pm line 78. > > > > > > > > Wasn't necessary though if I just used the Sort control by itself. > > > > > > > ----- End forwarded message ----- > > > > > > |
From: Mark W. <mew...@un...> - 2000-07-03 15:35:13
|
sorry I don't. I couldn't find anything on the IETF site as well. I wonder if it's buried in a MS document somewhere, hidden by an NDA :). But I did remember another argument for not including the paged-control in the search method, it's a proprietary control for Active Directory (this is perfectly legal LDAP, however ;). It will be replaced by the Virtual List View control in future versions of AD, because VLV provides everything Page control does, but it's being agreed upon by Netscape, Microsoft and Novell, thus should be more standardized across the board (I know Netscape already supports it, I think Novell does). Mark On Mon, 3 Jul 2000, Graham Barr wrote: > Does anyone know when a Paged search is complete ? > > ----- Forwarded message from "Allen, Robbie" <ra...@ci...> ----- > > From: "Allen, Robbie" <ra...@ci...> > To: "'Graham Barr'" <gb...@po...> > Subject: RE: Page or VLV control > Date: Sun, 2 Jul 2000 12:49:13 -0700 > X-Mailer: Internet Mail Service (5.5.2650.21) > > Yep, that's better. So here is the finished product that works for me: > > #----------------------------------------------------# > use Net::LDAP; > use Net::LDAP::Control; > use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED LDAP_CONTROL_SORTREQUEST > ); > > ... > > $page = Net::LDAP::Control->new( LDAP_CONTROL_PAGED, size => 1000); > $sort = Net::LDAP::Control->new( LDAP_CONTROL_SORTREQUEST, order => > 'cn'); > @args = ( base => "cn=subnets,cn=sites,cn=configuration,$BASE_DN", > scope => "subtree", > filter => "(objectClass=subnet)", > control => [ $sort, $page ] ); > while (($mesg = $LDAP->search( @args ))) { > print_subnet($_) foreach $mesg->entries; > last if $mesg->count < $page->size; > ($resp) = $mesg->control( LDAP_CONTROL_PAGED ); > $page->cookie($resp->cookie); > } > #----------------------------------------------------# > > The only question that still remains for me is the best way to determine > a Paged search is complete. Above I just check to see if the mesg count > is less than the page size, but seems like there should be a more > intuitive approach. The search inside the while clause isn't a good > check, because after the search completes, it starts over again from 1 > (and continues), so the only way to break out of the loop is with the > 'last' call. > > Thanks for working on this!!! This is the critical piece I was missing > to start automating a lot of our Active Directory processes. > > Robbie Allen > > > > -----Original Message----- > > From: Graham Barr [mailto:gb...@po...] > > Sent: Sunday, July 02, 2000 12:01 AM > > To: Allen, Robbie > > Subject: Re: Page or VLV control > > > > > > Ah, OK. Try this new patch > > > > Graham. > > > > On Sat, Jul 01, 2000 at 08:32:35PM -0700, Allen, Robbie wrote: > > > Works! At least for Paged and Sort, haven't tried VLV yet. > > For some > > > reason, when I used both Paged and Sort together, I also > > had to 'use' > > > SortResult.pm or else it complained that it couldn't find init: > > > > > > Can't locate object method "init" via package > > > "Net::LDAP::Control::SortResult" a > > > t /usr/SD/perl5.004_05/lib/site_perl/Net/LDAP/Control.pm line 78. > > > > > > Wasn't necessary though if I just used the Sort control by itself. > > > > ----- End forwarded message ----- > > |
From: Mark W. <mew...@un...> - 2000-07-03 15:29:17
|
It should be integrated into the search method via a control as it is now. The purpose of controls is to enxtend or enhance the functionality of a particular LDAP operation. The biggest problem with this is that it makes your life easier because you have a paged controls on your LDAP Server. But my server doesn't use paged controls, instead it supports the Virtual List View control. In other words I think it's a bad idea because: 1) it violates the idea behind the use of LDAP controls 2) it makes the API harder to use 3) it makes the API less flexible Now if you have a better idea about how to make controls work & you can provide patches or code, I think we're all ears :). Mark On Sun, 2 Jul 2000, Allen, Robbie wrote: > Would it be feasible to merge the Paged control into the search method? > Generally when I do searches, I want all the entries returned regardless > of the server limit. In fact, some searches I do today will get all > entries, because the number returned does not exceed the server limit. > One day that may not be the case. I could see it as either being > integrated into the current search method's or even a separate one. > > $ldap->search( @args, > paged => 1, > pagesize => 1000); > > $ldap->search_paged( @args, > pagesize => 1000 ); > > Comments? > > Robbie Allen > > |
From: Graham B. <gb...@po...> - 2000-07-03 15:06:50
|
On Sun, Jul 02, 2000 at 07:39:53PM -0700, Allen, Robbie wrote: > Would it be feasible to merge the Paged control into the search method? > Generally when I do searches, I want all the entries returned regardless > of the server limit. In fact, some searches I do today will get all > entries, because the number returned does not exceed the server limit. > One day that may not be the case. I could see it as either being > integrated into the current search method's or even a separate one. > > $ldap->search( @args, > paged => 1, > pagesize => 1000); This was my intent once certain controls started to become more standard. The search method should be able to create the right controls to send. But in some cases you need the controls returned from the previous search. For example with paged the server will return a control with a cookie. You should use this cookie in requesting the next page. Also in answer to your previous question, this cookie is unset when the current result is the last page. See rfc2696 Graham. |
From: Mark W. <mew...@un...> - 2000-07-03 15:01:31
|
This sounds like a bug we had in .17 or .18. Make sure you're using Net::LDAP .19 and the latest version Convert::ASN1. Mark On Sun, 2 Jul 2000, Graham Barr wrote: > ----- Forwarded message from Jie Gao <J....@is...> ----- > > Date: Sun, 2 Jul 2000 17:26:43 +1000 (EST) > From: Jie Gao <J....@is...> > To: gb...@po... > Subject: feedback on Net::LDAP > > Dear Graham, > > On Net::LDAP::FAQ manual page, there is this paragraph: > > # as an array > > my $max = $mesg->count; # How many entries were returned from the search > > for( my $index = 0 ; $index < $max ; $index++) { > my $entry = $mesg->entry($index); > # ... > } > > # or as a stack > > while( my $entry = $mesg->shift_entry) { > # ... > } > > I found the 2nd method won't work: it just hangs at the end of the loop. > > The first one works wonderfully. > > Thanks, > > > > Jie > > > > > > ----- End forwarded message ----- > > |
From: Graham B. <gb...@po...> - 2000-07-03 15:00:47
|
Does anyone know when a Paged search is complete ? ----- Forwarded message from "Allen, Robbie" <ra...@ci...> ----- From: "Allen, Robbie" <ra...@ci...> To: "'Graham Barr'" <gb...@po...> Subject: RE: Page or VLV control Date: Sun, 2 Jul 2000 12:49:13 -0700 X-Mailer: Internet Mail Service (5.5.2650.21) Yep, that's better. So here is the finished product that works for me: #----------------------------------------------------# use Net::LDAP; use Net::LDAP::Control; use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED LDAP_CONTROL_SORTREQUEST ); ... $page = Net::LDAP::Control->new( LDAP_CONTROL_PAGED, size => 1000); $sort = Net::LDAP::Control->new( LDAP_CONTROL_SORTREQUEST, order => 'cn'); @args = ( base => "cn=subnets,cn=sites,cn=configuration,$BASE_DN", scope => "subtree", filter => "(objectClass=subnet)", control => [ $sort, $page ] ); while (($mesg = $LDAP->search( @args ))) { print_subnet($_) foreach $mesg->entries; last if $mesg->count < $page->size; ($resp) = $mesg->control( LDAP_CONTROL_PAGED ); $page->cookie($resp->cookie); } #----------------------------------------------------# The only question that still remains for me is the best way to determine a Paged search is complete. Above I just check to see if the mesg count is less than the page size, but seems like there should be a more intuitive approach. The search inside the while clause isn't a good check, because after the search completes, it starts over again from 1 (and continues), so the only way to break out of the loop is with the 'last' call. Thanks for working on this!!! This is the critical piece I was missing to start automating a lot of our Active Directory processes. Robbie Allen > -----Original Message----- > From: Graham Barr [mailto:gb...@po...] > Sent: Sunday, July 02, 2000 12:01 AM > To: Allen, Robbie > Subject: Re: Page or VLV control > > > Ah, OK. Try this new patch > > Graham. > > On Sat, Jul 01, 2000 at 08:32:35PM -0700, Allen, Robbie wrote: > > Works! At least for Paged and Sort, haven't tried VLV yet. > For some > > reason, when I used both Paged and Sort together, I also > had to 'use' > > SortResult.pm or else it complained that it couldn't find init: > > > > Can't locate object method "init" via package > > "Net::LDAP::Control::SortResult" a > > t /usr/SD/perl5.004_05/lib/site_perl/Net/LDAP/Control.pm line 78. > > > > Wasn't necessary though if I just used the Sort control by itself. > ----- End forwarded message ----- |
From: Allen, R. <ra...@ci...> - 2000-07-03 14:23:36
|
Would it be feasible to merge the Paged control into the search method? Generally when I do searches, I want all the entries returned regardless of the server limit. In fact, some searches I do today will get all entries, because the number returned does not exceed the server limit. One day that may not be the case. I could see it as either being integrated into the current search method's or even a separate one. $ldap->search( @args, paged => 1, pagesize => 1000); $ldap->search_paged( @args, pagesize => 1000 ); Comments? Robbie Allen |
From: Rui M. <rmo...@wh...> - 2000-07-03 13:02:15
|
Hello again. i have perl 5.005_03 and perl-ldap.0.19 working OK. Regards. Chris Ridd wrote: > > Hi all. > > > > What version of perl-ldap module are you working with ? > > > > I use shift_entry method in several parts of my code, and it works OK. > > I'm currently using version 0.19 of perl-ldap module. > > > > Regards. > > > > Rui. > > The version of perl that is being used would also be useful, given the > current slew of "it doesn't work in 5.6.0" messages :-) > > Cheers, > > Chris -- Rui Monteiro WhatEverNet Computing, SA rmo...@wh... Praca de Alvalade, 6 - Piso 6 Phone: +351 21 7994200 1700 036 Lisboa - Portugal Fax: +351 21 7994242 http://www.whatevernet.pt |
From: Chris R. <Chr...@me...> - 2000-07-03 11:10:52
|
> Hi all. > > What version of perl-ldap module are you working with ? > > I use shift_entry method in several parts of my code, and it works OK. > I'm currently using version 0.19 of perl-ldap module. > > Regards. > > Rui. The version of perl that is being used would also be useful, given the current slew of "it doesn't work in 5.6.0" messages :-) Cheers, Chris |
From: Rui M. <rmo...@wh...> - 2000-07-03 09:15:27
|
Hi all. What version of perl-ldap module are you working with ? I use shift_entry method in several parts of my code, and it works OK. I'm currently using version 0.19 of perl-ldap module. Regards. Rui. Graham Barr wrote: > ----- Forwarded message from Jie Gao <J....@is...> ----- > > Date: Sun, 2 Jul 2000 17:26:43 +1000 (EST) > From: Jie Gao <J....@is...> > To: gb...@po... > Subject: feedback on Net::LDAP > > Dear Graham, > > On Net::LDAP::FAQ manual page, there is this paragraph: > > # as an array > > my $max = $mesg->count; # How many entries were returned from the search > > for( my $index = 0 ; $index < $max ; $index++) { > my $entry = $mesg->entry($index); > # ... > } > > # or as a stack > > while( my $entry = $mesg->shift_entry) { > # ... > } > > I found the 2nd method won't work: it just hangs at the end of the loop. > > The first one works wonderfully. > > Thanks, > > Jie > > ----- End forwarded message ----- -- Rui Monteiro WhatEverNet Computing, SA rmo...@wh... Praca de Alvalade, 6 - Piso 6 Phone: +351 21 7994200 1700 036 Lisboa - Portugal Fax: +351 21 7994242 http://www.whatevernet.pt |
From: Graham B. <gb...@po...> - 2000-07-02 11:09:58
|
----- Forwarded message from Jie Gao <J....@is...> ----- Date: Sun, 2 Jul 2000 17:26:43 +1000 (EST) From: Jie Gao <J....@is...> To: gb...@po... Subject: feedback on Net::LDAP Dear Graham, On Net::LDAP::FAQ manual page, there is this paragraph: # as an array my $max = $mesg->count; # How many entries were returned from the search for( my $index = 0 ; $index < $max ; $index++) { my $entry = $mesg->entry($index); # ... } # or as a stack while( my $entry = $mesg->shift_entry) { # ... } I found the 2nd method won't work: it just hangs at the end of the loop. The first one works wonderfully. Thanks, Jie ----- End forwarded message ----- |
From: Graham B. <gb...@po...> - 2000-06-30 15:27:41
|
----- Forwarded message from "Dan" <da...@do...> ----- From: "Dan" <da...@do...> To: gb...@po... Date: Fri, 30 Jun 2000 11:15:02 GMT Subject: Modify method not working I am trying to use Net::LDAP::Entry. So far it adds entries wonderfully, but cannot modify is this a known issue? I will provide my test code if requested. Thanks! ----- End forwarded message ----- |
From: Jim H. <ha...@us...> - 2000-06-29 18:51:43
|
Eric, I have attached code that will find all attributes without using ldap->schema(). For your second question, it depends on what you want to really search for. If all you want to know is whether an object of a given dn exists, you can use code like $mesg = $ldap->search ( base => $testdn, scope => 0, filter => "(objectclass=*)" ); If the search succeeds, $testdn already exists. If you, however, want to make sure that you are adding an object where the lowest level of the dn is unique, the search is different. This might be when you are looking to add a user with uid=joe, but you want to make sure that not only is there not a "joe" in dept1, but not anywhere. If this is the case, then you need to make sure that all your users have a uid attribute, not just uid as part of the dn. Then the search becomes $mesg = $ldap->search ( base => $normalbase filter => "(uid=$testuid)" ); Jim Harle US Naval Academy On Thu, 29 Jun 2000, Graham Barr wrote: > ----- Forwarded message from Eric Zhou <eri...@ya...> ----- > > Date: Thu, 29 Jun 2000 10:55:36 -0700 (PDT) > From: Eric Zhou <eri...@ya...> > Subject: retrieve perl-ldap schema and ldap search > To: Graham Barr <gb...@po...> > > hi,Graham: > > remember I asked you an address the other day about > two perl module. I am still not that far yet. > I have been able to use ldap->add() and ldap->modify() > function to do some simple stuff. > > do you have some handy example of how to use > ldap->schema to retrieve schema of ldap tree? > the other thing is that I don't quite understand > your ldap->search() doing. because I wish to search > and dn in the ldap tree and see if it is there before > I insert it. do I suppose to use ldap->search() or > ldap->compare(). > > > thank you very much. > > Eric > > > __________________________________________________ > Do You Yahoo!? > Get Yahoo! Mail - Free email you can access from anywhere! > http://mail.yahoo.com/ > > ----- End forwarded message ----- > > |
From: Mark W. <mew...@un...> - 2000-06-29 18:25:39
|
On Thu, 29 Jun 2000, Graham Barr wrote: > ----- Forwarded message from Eric Zhou <eri...@ya...> ----- > > Date: Thu, 29 Jun 2000 10:55:36 -0700 (PDT) > From: Eric Zhou <eri...@ya...> > Subject: retrieve perl-ldap schema and ldap search > To: Graham Barr <gb...@po...> > > hi,Graham: > > remember I asked you an address the other day about > two perl module. I am still not that far yet. > I have been able to use ldap->add() and ldap->modify() > function to do some simple stuff. > > do you have some handy example of how to use > ldap->schema to retrieve schema of ldap tree? This should work: my $schema = $ldap->schema(dn=>"name of your server's schema object"); To get information about the schema look at the documenation for Net::LDAP::Schema. > the other thing is that I don't quite understand > your ldap->search() doing. because I wish to search > and dn in the ldap tree and see if it is there before > I insert it. do I suppose to use ldap->search() or > ldap->compare(). The simplest way to check for the existence of an entry is to do a search (this is not a misunderstanding of Net::LDAP, just a misunderstanding of LDAP ;). Set your base to be the DN of the entry, scope of base and a filter of "objectclass=*". like this: $ldap->search( base => "uid=mewilcox,ou=people,dc=unt,dc=edu", scope => "base", filter => "objectclass", ); if you get an error code of zero then the entry exists. If you get an error code of 32 then the entry doesn't exist. Mark > > > thank you very much. > > Eric > > > __________________________________________________ > Do You Yahoo!? > Get Yahoo! Mail - Free email you can access from anywhere! > http://mail.yahoo.com/ > > ----- End forwarded message ----- > > |
From: Graham B. <gb...@po...> - 2000-06-29 18:07:51
|
----- Forwarded message from Eric Zhou <eri...@ya...> ----- Date: Thu, 29 Jun 2000 10:55:36 -0700 (PDT) From: Eric Zhou <eri...@ya...> Subject: retrieve perl-ldap schema and ldap search To: Graham Barr <gb...@po...> hi,Graham: remember I asked you an address the other day about two perl module. I am still not that far yet. I have been able to use ldap->add() and ldap->modify() function to do some simple stuff. do you have some handy example of how to use ldap->schema to retrieve schema of ldap tree? the other thing is that I don't quite understand your ldap->search() doing. because I wish to search and dn in the ldap tree and see if it is there before I insert it. do I suppose to use ldap->search() or ldap->compare(). thank you very much. Eric __________________________________________________ Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/ ----- End forwarded message ----- |
From: Chris R. <Chr...@me...> - 2000-06-29 18:07:15
|
On Thu, 29 Jun 2000 18:22:00 BST, Graham Barr wrote: > ----- Forwarded message from "Piggott, Christopher" <ch...@ad...> ----- > > From: "Piggott, Christopher" <ch...@ad...> > To: "'gb...@po...'" <gb...@po...> > Subject: Net::LDAP question > Date: Thu, 29 Jun 2000 13:12:45 -0400 > X-Mailer: Internet Mail Service (5.5.2650.21) > > Hi Graham, > > Sorry to bother you. Using Net::LDAP can you retrieve an entire ldap > server's contents? I have tried: > my $filter = ""; > my $filter = "(cn=*)"; > etc. but am coming up empty. My basic structure is: > > $mesg = $ldap->search(base => "c=*", filter = $filter); > > I know for sure that the ldap connection is good, because if I search where > $filter = "(cn=*Piggott*") it returns my own record. The server is > Microsoft Exchange Server. You almost certainly won't be able to get all the entries from a directory using a single operation. Servers have controls to prevent you from doing that, called the sizelimit and the timelimit. The normal approach is therefore: start at the top entry you want; read it; get the names of all the immediate subordinate entries; read them, and then repeat (recurse or iterate) through all the subordinate entries, doing the same thing etc etc. This way you have multiple searches, and the sizelimits etc only apply to individual searches, ie layers of the directory. There's a particular problem with your search however: $mesg = $ldap->search(base => "c=*", filter = $filter); That is saying start from an entry called c=* and perform some kind of search. I'm betting you don't have an entry called c=*, which is why your search is failing (it should fail with a name error.) You cannot specify a search base using wildcards or expressions - the search base must be the DN of an actual entry. Your search base might be c=US, for instance. Your search will also only locate the entries with 'cn' attributes. Not all entries have 'cn' attributes, so you might want to search for something that all entries do have. A filter of '(objectclass=*)' is the normal way to do this. Cheers, Chris |
From: Graham B. <gb...@po...> - 2000-06-29 17:30:50
|
----- Forwarded message from "Piggott, Christopher" <ch...@ad...> ----- From: "Piggott, Christopher" <ch...@ad...> To: "'gb...@po...'" <gb...@po...> Subject: Net::LDAP question Date: Thu, 29 Jun 2000 13:12:45 -0400 X-Mailer: Internet Mail Service (5.5.2650.21) Hi Graham, Sorry to bother you. Using Net::LDAP can you retrieve an entire ldap server's contents? I have tried: my $filter = ""; my $filter = "(cn=*)"; etc. but am coming up empty. My basic structure is: $mesg = $ldap->search(base => "c=*", filter = $filter); I know for sure that the ldap connection is good, because if I search where $filter = "(cn=*Piggott*") it returns my own record. The server is Microsoft Exchange Server. ---------- Christopher Piggott Director of Technical Services and Web Development Adaptive Broadband (716) 742-6166 mailto:ch...@ad... <<Christopher Piggott.vcf>> ----- End forwarded message ----- |
From: Graham B. <gb...@po...> - 2000-06-29 08:48:38
|
I have added two new modules to CVS that will be in the next release. Net::LDAPS from Chris Ridd Net::LDAP::DSML from Mark Wilcox Please try them out and report and problems/patches to the list. many thanks to both. Graham. PS: Mark, Chris, I made a few cosmetic changes, mainly to the PODs |
From: Mark W. <mew...@lo...> - 2000-06-28 01:07:41
|
Here's a full copy of Net::LDAP::DSML (I was missing the DSML parser module). I also slightly modified the documentation to show how to pass a file GLOB to Net::LDAP::DSML. Mark |
From: Graham B. <gb...@po...> - 2000-06-27 20:34:27
|
Can you turn on debug with $ldap->debug(3); and send the packet you get just before the decode error. Graham. On Tue, Jun 27, 2000 at 11:42:25AM -0700, Allen, Robbie wrote: > Thanks. The controls seem to make it to the server ok, but I get a > decode error after the search method. Subsequently, the control method > in Message.pm always returns undef. So for Paged and VLV, I can only > get the first set of data. This is not a problem Sort since it is only > called once (which works fine btw). > > #================================================ > > Output: > > Net::LDAP::VERSION = 0.19 > Convert::ASN1::VERSION = 0.07 > Error msg: decode error at > /usr/SD/perl5.004_05/lib/site_perl/Convert/ASN1/_decode.pm line 63. > Resp = > > #================================================ > > Code: > > use Net::LDAP; > use Net::LDAP::Control; # this wouldn't be necessary if Paged.pm use'd > it > use Net::LDAP::Control::Paged; > use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED ); > > print "Net::LDAP::VERSION = $Net::LDAP::VERSION\n"; > print "Convert::ASN1::VERSION = $Convert::ASN1::VERSION\n"; > > my $ldap = Net::LDAP->new($LDAP_SERVER) or die "$@"; > my $mesg = $ldap->bind('dn' => $BIND_DN, 'password' => $PASSWD); > $mesg->code && die $mesg->error; > > $page = Net::LDAP::Control::Paged->new( size => 10); > $mesg = > $ldap->search(base=>"cn=subnets,cn=sites,cn=configuration,$BASE_DN", > scope=>"subtree", > filter=>"(objectClass=subnet)", > control => [ $page ]); > print "Error msg: ",$mesg->error,"\n" if $mesg->error; > $resp = $mesg->control( LDAP_CONTROL_PAGED ); > print "Resp = $resp\n"; > > #================================================ > > > > -----Original Message----- > > From: Graham Barr [mailto:gb...@po...] > > Sent: Monday, June 26, 2000 10:17 PM > > To: Allen, Robbie > > Cc: 'per...@li...' > > Subject: Re: Page or VLV control > > > > > > On Mon, Jun 26, 2000 at 08:18:34PM -0700, Allen, Robbie wrote: > > > Do the VLV.pm or Paged.pm modules work under Net::LDAP? If > > so, do you > > > have any examples? > > > > Both of these are still under developement, so feel free to > > give any feedback. > > > > Paged should work something like > > > > $paged = Net::LDAP::Control::Paged->new( size => 10 ); > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > $ctrl = $mesg->control( LDAP_CONTROL_PAGED ); > > > > $paged->cookie($ctrl->cookie) if $ctrl; > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > VLV takes these arguments > > > > $vlv = Net::LDAP::Control::VLV->new( > > before => $beforeCount, > > after => $afterCount, > > assert => $assertValue, > > offset => $offset, > > content => $contentCount, > > context => $contextID, # just noticed a bug that this > > is missing from new() > > ); > > > > If assert is present offset and content are not used. There > > are methods > > by the same names for setting the values. > > > > In the response you will get a LDAP_CONTROL_VLVRESPONSE which > > will have > > methods target, result, content and context > > > > Graham. > > > > > > |
From: Graham B. <gb...@po...> - 2000-06-27 19:28:44
|
Thanks for an update. I will include this somewhere in the docs, I just have to decide where :) Graham. On Tue, Jun 27, 2000 at 11:31:30AM -0500, Bryan Thale wrote: > Thanks for your help Graham. > > Here is what I finally ended up with based on your outline, a little > wrapper routine to do the dirty work waiting for the request to complete > or time out. > > # > # Wait for an async request to complete or time out > # > sub async_request > { > my ($ldap, $completion, $timeout) = @_; > > my $selector = IO::Select->new( $ldap->socket ); > > while ($selector->can_read( $timeout )) > { > $ldap->_recvresp(); > last if ($completion->done()); > } > > return $completion; > } > > It seems to be catching all three failure modes that I've observed from > my LDAP server. > > Thanks, > Bryan. > > > -- > Bryan Thale > Motorola Labs, Networking and Infrastructure Research > mailto:th...@rs... > > > |
From: Allen, R. <ra...@ci...> - 2000-06-27 18:51:25
|
> > The controls (Sort.pm, VLV.pm, etc.) should probably 'use > > Net::LDAP::Control'. > > Yes they should. However the original intend use was > > Net::LDAP::Control->new( LDAP_CONTROL_VLVREQUEST ); > > So Net::LDAP::Control would already have been loaded anyway. Yes, that makes more sense and was originally how I thought it was implemented. Robbie Allen > > > > > When I try to replace new with init, I get this: > > > "Can't use string ("Net::LDAP::Control::Sort") as a HASH ref > > > while "strict > > > refs" in use at > > > /usr/lib/perl5/site_perl/5.005/Net/LDAP/Control/Sort.pm > > > line 19." > > > > > > I get the same thing if I change init to new in the Sort.pm file. > > > > > > I'm using Perl 5.005_03 on Linux with Net::LDAP .19 and > > > Convert::ASN1 .04. > > > > > > And here's the code I'm using to setup the Sort control: > > > $sort = Net::LDAP::Control::Sort->new( > > > order => "cn" > > > ); > > > > > > > > > BTW If you use the VLV control, remember you must also > include a sort > > > control as well. > > > > > > Mark > > > > > > > > > On Tue, 27 Jun 2000, Graham Barr wrote: > > > > > > > On Mon, Jun 26, 2000 at 08:18:34PM -0700, Allen, Robbie wrote: > > > > > Do the VLV.pm or Paged.pm modules work under Net::LDAP? > > > If so, do you > > > > > have any examples? > > > > > > > > Both of these are still under developement, so feel free to > > > give any feedback. > > > > > > > > Paged should work something like > > > > > > > > $paged = Net::LDAP::Control::Paged->new( size => 10 ); > > > > > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > > > > > $ctrl = $mesg->control( LDAP_CONTROL_PAGED ); > > > > > > > > $paged->cookie($ctrl->cookie) if $ctrl; > > > > > > > > $mesg = $ldap->search( control => [ $paged ], .... ); > > > > > > > > VLV takes these arguments > > > > > > > > $vlv = Net::LDAP::Control::VLV->new( > > > > before => $beforeCount, > > > > after => $afterCount, > > > > assert => $assertValue, > > > > offset => $offset, > > > > content => $contentCount, > > > > context => $contextID, # just noticed a bug that this > > > is missing from new() > > > > ); > > > > > > > > If assert is present offset and content are not used. There > > > are methods > > > > by the same names for setting the values. > > > > > > > > In the response you will get a LDAP_CONTROL_VLVRESPONSE > > > which will have > > > > methods target, result, content and context > > > > > > > > Graham. > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
From: Allen, R. <ra...@ci...> - 2000-06-27 18:47:14
|
Thanks. The controls seem to make it to the server ok, but I get a decode error after the search method. Subsequently, the control method in Message.pm always returns undef. So for Paged and VLV, I can only get the first set of data. This is not a problem Sort since it is only called once (which works fine btw). #================================================ Output: Net::LDAP::VERSION = 0.19 Convert::ASN1::VERSION = 0.07 Error msg: decode error at /usr/SD/perl5.004_05/lib/site_perl/Convert/ASN1/_decode.pm line 63. Resp = #================================================ Code: use Net::LDAP; use Net::LDAP::Control; # this wouldn't be necessary if Paged.pm use'd it use Net::LDAP::Control::Paged; use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED ); print "Net::LDAP::VERSION = $Net::LDAP::VERSION\n"; print "Convert::ASN1::VERSION = $Convert::ASN1::VERSION\n"; my $ldap = Net::LDAP->new($LDAP_SERVER) or die "$@"; my $mesg = $ldap->bind('dn' => $BIND_DN, 'password' => $PASSWD); $mesg->code && die $mesg->error; $page = Net::LDAP::Control::Paged->new( size => 10); $mesg = $ldap->search(base=>"cn=subnets,cn=sites,cn=configuration,$BASE_DN", scope=>"subtree", filter=>"(objectClass=subnet)", control => [ $page ]); print "Error msg: ",$mesg->error,"\n" if $mesg->error; $resp = $mesg->control( LDAP_CONTROL_PAGED ); print "Resp = $resp\n"; #================================================ > -----Original Message----- > From: Graham Barr [mailto:gb...@po...] > Sent: Monday, June 26, 2000 10:17 PM > To: Allen, Robbie > Cc: 'per...@li...' > Subject: Re: Page or VLV control > > > On Mon, Jun 26, 2000 at 08:18:34PM -0700, Allen, Robbie wrote: > > Do the VLV.pm or Paged.pm modules work under Net::LDAP? If > so, do you > > have any examples? > > Both of these are still under developement, so feel free to > give any feedback. > > Paged should work something like > > $paged = Net::LDAP::Control::Paged->new( size => 10 ); > > $mesg = $ldap->search( control => [ $paged ], .... ); > > $ctrl = $mesg->control( LDAP_CONTROL_PAGED ); > > $paged->cookie($ctrl->cookie) if $ctrl; > > $mesg = $ldap->search( control => [ $paged ], .... ); > > VLV takes these arguments > > $vlv = Net::LDAP::Control::VLV->new( > before => $beforeCount, > after => $afterCount, > assert => $assertValue, > offset => $offset, > content => $contentCount, > context => $contextID, # just noticed a bug that this > is missing from new() > ); > > If assert is present offset and content are not used. There > are methods > by the same names for setting the values. > > In the response you will get a LDAP_CONTROL_VLVRESPONSE which > will have > methods target, result, content and context > > Graham. > > > |
From: Bryan T. <th...@rs...> - 2000-06-27 16:35:38
|
Thanks for your help Graham. Here is what I finally ended up with based on your outline, a little wrapper routine to do the dirty work waiting for the request to complete or time out. # # Wait for an async request to complete or time out # sub async_request { my ($ldap, $completion, $timeout) = @_; my $selector = IO::Select->new( $ldap->socket ); while ($selector->can_read( $timeout )) { $ldap->_recvresp(); last if ($completion->done()); } return $completion; } It seems to be catching all three failure modes that I've observed from my LDAP server. Thanks, Bryan. -- Bryan Thale Motorola Labs, Networking and Infrastructure Research mailto:th...@rs... |
From: Mark W. <mew...@un...> - 2000-06-27 16:19:50
|
On Tue, 27 Jun 2000, Graham Barr wrote: > > And here's the code I'm using to setup the Sort control: > > $sort = Net::LDAP::Control::Sort->new( > > order => "cn" > > ); > > That should work, does it ? Yeah after I imported Net::LDAP::Control ;). > > > > > BTW If you use the VLV control, remember you must also include a sort > > control as well. > > Ah yes. That will be in the docs, when I (or someone else) write them :) The same ol' problem ;). Mark > > Graham. > |