Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Problem with Net::LDAP::Control::Paged and Oracle Internet Directory
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Ridd  
View profile  
 More options Jan 19 2012, 7:12 am
Newsgroups: perl.ldap
From: chrisr...@mac.com (Chris Ridd)
Date: Thu, 19 Jan 2012 12:12:05 +0000
Local: Thurs, Jan 19 2012 7:12 am
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On 19 Jan 2012, at 01:35, John Devitofranceschi wrote:

Not as far as I know, but perhaps no-one has tried this combination out much.

You've elided some code - I take it the elided code sets the page cookie as per the man page example?

A decode of the last received packet looks like this:

   0   69: SEQUENCE {
   6    1:   INTEGER 1
   9   60:   [APPLICATION 5] {
  15    1:     ENUMERATED 0
  18    0:     OCTET STRING
  20    0:     OCTET STRING
  22   47:     [0] {
  28   41:       SEQUENCE {
  34   22:         OCTET STRING '1.2.840.113556.1.4.319'
  58    1:         BOOLEAN FALSE
  61   12:         OCTET STRING 30 0A 02 01 00 04 05 35 31 61 32 66
         :         }
         :       }
         :     }
         :   }

(Output from dumpasn1 -z -e.)

In other words, it is an LDAPMessage with messageID 1 and a SearchResultDone ([APPLICATION 5] { ... }) and a sequence of Controls ([0] { ... }).

However, the nesting is wrong - the Controls (starting at byte 22) are being encoded inside the SearchResultDone. That's not correct - they should be in the outer LDAPMessage instead. Something like this:

         : SEQUENCE {
         :   INTEGER 1
         :   [APPLICATION 5] {
         :     ENUMERATED 0
         :     OCTET STRING
         :     OCTET STRING
         :     }
         :   [0] {
         :     SEQUENCE {
         :       OCTET STRING '1.2.840.113556.1.4.319'
         :       BOOLEAN FALSE
         :       OCTET STRING 30 0A 02 01 00 04 05 35 31 61 32 66
         :       }
         :     }
         :   }

I think Oracle's sending bad protocol back.

However I don't /think/ we should be barfing like that, as LDAP has built-in extensibility rules which state that clients/servers should try to ignore bits of unexpected data as long as they're in the "right place". IIRC you can put in custom stuff but only at the ends of certain structures and we should just ignore it. But even if we ignored it, we still wouldn't find Oracle's misplaced paged results control :-(

Two bugs for the price of one!

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Ridd  
View profile  
 More options Jan 19 2012, 8:21 am
Newsgroups: perl.ldap
From: chrisr...@mac.com (Chris Ridd)
Date: Thu, 19 Jan 2012 13:21:41 +0000
Local: Thurs, Jan 19 2012 8:21 am
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On 19 Jan 2012, at 12:39, John Devitofranceschi wrote:

> Two bugs! Such a deal!

No extra charge :-)

> Yes, the cookie setting code is in the while (1) loop and the callback merely prints out the dn of the returned entries.

You mentioned that the OpenLDAP ldapsearch command-line tool seemed to work. Can you double-check it is getting multiple pages back (try using pr=2/prompt), or whether it is stopping after the first page because of the misplaced result cookie?

The only other difference I can see between your ldapsearch args and your Net::LDAP code is that the control's criticality is different. Does varying that affect things?

> Thanks very much for the quick analysis. I'll need to add dumpasn1 to my bag of tricks!

You can get Net::LDAP to output something similar to dumpasn1's using $ldap->debug(8). The value is a bitmask, and the bits are described in the Net::LDAP man page. But dumpasn1 is a handy tool to have around anyway.

Cheers,

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Devitofranceschi  
View profile  
 More options Jan 19 2012, 9:00 am
Newsgroups: perl.ldap
From: j...@optonline.net (John Devitofranceschi)
Date: Thu, 19 Jan 2012 09:00:22 -0500
Local: Thurs, Jan 19 2012 9:00 am
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On Jan 19, 2012, at 8:21, Chris Ridd <chrisr...@mac.com> wrote:

> On 19 Jan 2012, at 12:39, John Devitofranceschi wrote:

>> Two bugs! Such a deal!

> No extra charge :-)

>> Yes, the cookie setting code is in the while (1) loop and the callback merely prints out the dn of the returned entries.

> You mentioned that the OpenLDAP ldapsearch command-line tool seemed to work. Can you double-check it is getting multiple pages back (try using pr=2/prompt), or whether it is stopping after the first page because of the misplaced result cookie?

OpenLDAP's ldapsearch works as expected. Multiple pages get returned.

> The only other difference I can see between your ldapsearch args and your Net::LDAP code is that the control's criticality is different. Does varying that affect things?

Changing the criticality makes no difference in either case. It either continues to work in the ldapsearch case or continues to fail in the perl-ldap case.

>> Thanks very much for the quick analysis. I'll need to add dumpasn1 to my bag of tricks!

> You can get Net::LDAP to output something similar to dumpasn1's using $ldap->debug(8). The value is a bitmask, and the bits are described in the Net::LDAP man page. But dumpasn1 is a handy tool to have around anyway.

> Cheers,

> Chris

Thanks again,
jd

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Ridd  
View profile  
 More options Jan 19 2012, 9:05 am
Newsgroups: perl.ldap
From: chrisr...@mac.com (Chris Ridd)
Date: Thu, 19 Jan 2012 14:05:08 +0000
Local: Thurs, Jan 19 2012 9:05 am
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On 19 Jan 2012, at 14:00, John Devitofranceschi wrote:

That's puzzling, and suggests my analysis is wrong. Can you get some (snoop/tcpdump) packet traces from ldapsearch and perl up to and including the first page search done? It'll have passwords and your data in so if you want to send them off-list that's fine.

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Ridd  
View profile  
 More options Jan 19 2012, 3:16 pm
Newsgroups: perl.ldap
From: chrisr...@mac.com (Chris Ridd)
Date: Thu, 19 Jan 2012 20:16:11 +0000
Local: Thurs, Jan 19 2012 3:16 pm
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On 19 Jan 2012, at 14:05, Chris Ridd wrote:

Just to follow up on-list - the snoops that John sent me both showed that Oracle consistently sends the paged results control in the wrong place. Wireshark also complained.

Unless Oracle's shipping a version of ldapsearch that reads the control from the wrong place and counteracts their server bug, I'm puzzled how John's ldapsearch works.

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Devitofranceschi  
View profile  
 More options Jan 19 2012, 3:44 pm
Newsgroups: perl.ldap
From: j...@optonline.net (John Devitofranceschi)
Date: Thu, 19 Jan 2012 15:44:14 -0500
Local: Thurs, Jan 19 2012 3:44 pm
Subject: Re: Problem with Net::LDAP::Control::Paged and Oracle Internet Directory

On Jan 19, 2012, at 15:16, Chris Ridd <chrisr...@mac.com> wrote:

Actually, that ldapsearch is from Openldap on Redhat Linux.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »