From: Graham B. <gb...@po...> - 2000-09-11 18:24:15
|
Is it possible to get the server to do a full PDU dump so we can compare the PDUs send by ldapsearch and Net::LDAP ? Graham. On Mon, Sep 11, 2000 at 11:08:19AM -0700, Jeff Mandel wrote: > Correct summary on the sorts. > > My log from LDAP for successful sort shows > [11/Sep/2000:09:44:33 -0700] conn=2040 fd=56 slot=56 connection from > 10.1.8.10 to 10.1.2.5 > [11/Sep/2000:09:44:33 -0700] conn=2040 op=0 SRCH > base="ou=eugene,ou=computers,ou=devices,o=probes" scope=2 > filter="(&(objectclass=iphost)(uid=*)(objectclass=mpdevice))" > [11/Sep/2000:09:44:33 -0700] conn=2040 op=0 SORT uid devicefunction status > (275) > [11/Sep/2000:09:44:34 -0700] conn=2040 op=0 RESULT err=0 tag=101 > nentries=222 etime=1 > [11/Sep/2000:09:44:34 -0700] conn=2040 op=-1 fd=56 closed - B1 > > Log for failed sort is: > [11/Sep/2000:09:48:16 -0700] conn=2041 fd=56 slot=56 connection from > 10.1.8.10 to 10.1.2.5 > [11/Sep/2000:09:48:16 -0700] conn=2041 op=0 SRCH > base="ou=eugene,ou=computers,ou=devices,o=probes" scope=2 > filter="(&(objectclass=iphost)(uid=*)(objectclass=mpdevice))" > [11/Sep/2000:09:48:16 -0700] conn=2041 op=0 RESULT err=2 tag=101 nentries=0 > etime=0 > [11/Sep/2000:09:48:16 -0700] conn=2041 op=-1 fd=56 closed - B1 > > The sort request was somehow lost. No entries returned, nothing was logged > to the LDAP error log either. > > An error code was not returned to Net::LDAP, ie no response. So using the > example, I get "Server does not support sorting." > Should it return an error 2? > > Using the command line ldapsearch from the Netscape LDAP sdk I can get a > reverse sort. > ./ldapsearch -h host -b "ou=eugene,ou=computers,ou=devices,o=probes" -x -S > -uid uid=* uid cn > [11/Sep/2000:10:55:06 -0700] conn=2084 fd=56 slot=56 connection from > 10.1.8.10 to 10.1.2.5 > [11/Sep/2000:10:55:06 -0700] conn=2084 op=0 SRCH > base="ou=eugene,ou=computers,ou=devices,o=probes" scope=2 filter="(uid=*)" > [11/Sep/2000:10:55:06 -0700] conn=2084 op=0 SORT -uid (223) > [11/Sep/2000:10:55:06 -0700] conn=2084 op=0 RESULT err=0 tag=101 > nentries=222 etime=0 > [11/Sep/2000:10:55:06 -0700] conn=2084 op=1 UNBIND > [11/Sep/2000:10:55:06 -0700] conn=2084 op=1 fd=56 closed - U1 > > So perhaps it's in the encoding... Maybe the regex in Sort.pm is dropping a > piece of the request, including the sort order request instead of handling > the "-" > > Perhaps in here (from Sort.pm)... > > unless (defined $self->{value}) { > $self->{value} = $SortRequest->encode( > order => [ > map { > /^(-)?([^:]+)(?::(.+))?/; > { > type => $2, > (defined $1 ? (reverseOrder => 1) : ()), > (defined $3 ? (orderingRule => $3) : ()) > } > } @{$self->{order} || []} > ] > ) or $self->{error} = $@; > } > > > I wish my regex's skills we enough to help out here, but I have to defer to > the list on this. > > Jeff > > Graham Barr wrote: > > > Mark Wilcox had reported something similar (I had forgot about it) > > > > Are you saying > > > > forward sort on a single attribute works > > forward sort on a multiple attributes works > > reverse sort on a single attribute fails > > reverse sort on multipe attributes fails > > > > If so then it looks like the encoding of the reverse flag. But > > I looked at this when Mark reported the problem and the PDUs > > looked to be encoded OK. > > > > So the other question is does Netscape support reverse sorts ? > > > > Graham. > > > > On Mon, Sep 11, 2000 at 08:47:43AM -0700, Jeff Mandel wrote: > > > Hello, > > > > > > Has anyone successfully made the Netscape LDAP server return a reverse > > > sort? Regular or multi-key sort using the examples in > > > LDAP::Control::Sort, and Net::LDAP::Control::SortResult work great, but > > > passing in a "-attribute" (like "-uid") returns a "Server does not > > > support sorting." > > > > > > I'm using Netscape Directory 4.1 > > > > > > Thanks, > > > > > > Jeff > > > > |