[Date Prev][Date Next] [Chronological] [Thread] [Top]

Failure in decoding filter



Howard,

these filters are decoded correctly:

	(cn=And*o)
	(cn=A*o)

while these are failing:

	(cn=An*o)
	(cn=A*do)

In servers/slapd/get_substring_filter() the latter two cases
don't detect the end of the ber.  I can't tell if it's a decoding
or an encoding problem, though.  The debug outputs are:

<server>
begin get_substring_filter
ber_scanf fmt ({m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba4b end=0x081aba65 len=26
  0000:  a4 16 04 02 63 6e 30 10  80 01 61 82 02 64 6f 82  
....cn0...a..do.  
  0010:  01 04 82 01 04 82 01 21  30 00                    
.......!0.        
ber_scanf fmt (m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba53 end=0x081aba65 len=18
  0000:  80 01 61 82 02 64 6f 82  01 04 82 01 04 82 01 21  
..a..do........!  
  0010:  30 00                                             
0.                
  INITIAL
ber_scanf fmt (m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba56 end=0x081aba65 len=15
  0000:  00 02 64 6f 82 01 04 82  01 04 82 01 21 30 00     
..do........!0.   
  FINAL
ber_scanf fmt (m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba5a end=0x081aba65 len=11
  0000:  00 01 04 82 01 04 82 01  21 30 00                 
........!0.       
  FINAL
  error=2
end get_filter 0
    filter: (badfilter)
ber_scanf fmt ({M}}) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba5d end=0x081aba65 len=8
  0000:  00 01 04 82 01 21 30 00                           
.....!0.          
<= get_ctrls: n=136002088 rc=-2 err=unexpected data in PDU
</server>

<client>
Gee, I can't send you the client's log because with debug 
on it doesn't fail!  Ok, here's the output of ftest:

[masarati@mbdyn ldap-devel]$ ./libraries/libldap/ftest '(cn=a*do)'
Filter: (cn=a*do)
BER encoding (len=15):
  0000:  a4 0d 04 02 63 6e 30 07  80 01 61 82 02 64 6f     
....cn0...a..do   
[masarati@mbdyn ldap-devel]$ ./libraries/libldap/ftest -d -1 '(cn=a*do)'
Filter: (cn=a*do)
put_filter: "(cn=a*do)"
put_filter: simple
put_simple_filter: "cn=a*do"
put_substring_filter "cn=a*do"
BER encoding (len=22):
  0000:  a4 14 04 02 63 6e 30 0e  80 01 61 82 02 64 6f 82  
....cn0...a..do.  
  0010:  05 f8 f8 0d 08 21  

with the server logging 

begin get_substring_filter
ber_scanf fmt ({m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba4b end=0x081aba5c len=17
  0000:  a4 0d 04 02 63 6e 30 07  80 01 61 82 02 64 6f 30  
....cn0...a..do0  
  0010:  00                                                
.                 
ber_scanf fmt (m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba53 end=0x081aba5c len=9
  0000:  80 01 61 82 02 64 6f 30  00                       
..a..do0.         
  INITIAL
ber_scanf fmt (m) ber:
ber_dump: buf=0x081aba18 ptr=0x081aba56 end=0x081aba5c len=6
  0000:  00 02 64 6f 30 00                                 
..do0.            
  FINAL
</client>

Any comment?

Ando

-- 
Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 |
mailto:pierangelo.masarati@polimi.it
via La Masa 34, 20156 Milano, Italy   |
http://www.aero.polimi.it/~masarati