[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#4604) backs-sql: backsql_process_filter(): invalid filter for UTF-8 querys
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--1569075624-1215372281-1151766743=:19714
Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-ID: <Pine.LNX.4.64.0607011721151.19757@student.physik.uni-mainz.de>
On Sat, 1 Jul 2006, Pierangelo Masarati wrote:
>> Jul 1 09:51:10 hell slapd[25812]: filter:
>> (|(cn=3Dm\C3\BCl*)(?=3Dundefined)(sn=3Dm\C3\BCl*))
>
> This seems to indicate that the second AVA in your filter is incorrect.
> I have no idea as per what Thunderbird sends as search filter, but
> likely either that attribute is not defined in your slapd's schema, or
> its value does not comply with that attribute's syntax.
Oh, how could I've been so blind. Thanks for the hint. Here is the
result:
working filter, for entering "kepper" into thunderbird:
=3D=3D>backsql_search():=20
base=3D"dc=3Dfoo,dc=3Dde", filter=3D"(|(cn=3Dkepper*)(mail=3Dkepper*)(sn=3D=
kepper*))"
And here is what happens when I enter "M=FCller", the word
with the german special char:
=3D=3D>backsql_search():
base=3D"dc=3Dfoo,dc=3Dde", filter=3D"(|(cn=3Dm\C3\BCller*)(?=3Dundefined)(s=
n=3Dm\C3\BCller*))"
Now let's the why.
starting slapd with -d 255 showed up:
ldap_read: want=3D101, got=3D101
0000: 11 64 63 3d 64 69 65 66 69 72 6d 61 2c 64 63 3d .dc=3Ddiefirma,dc=
=3D
0010: 64 65 0a 01 02 0a 01 00 02 02 00 c8 02 01 00 01 de..............
0020: 01 00 a1 35 a4 0f 04 02 63 6e 30 09 80 07 6d c3 ...5....cn0...m.
0030: bc 6c 6c 65 72 a4 11 04 04 6d 61 69 6c 30 09 80 .ller....mail0..
0040: 07 6d c3 bc 6c 6c 65 72 a4 0f 04 02 73 6e 30 09 .m..ller....sn0.
0050: 80 07 6d c3 bc 6c 6c 65 72 30 0a 04 02 63 6e 04 ..m..ller0...cn.
0060: 04 6d 61 69 6c .mail
ber_get_next: tag 0x30 len 107 contents:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e08 end=3D0x08256e73 len=3D107
0000: 02 01 02 63 66 04 11 64 63 3d 64 69 65 66 69 72 ...cf..dc=3Ddiefir
0010: 6d 61 2c 64 63 3d 64 65 0a 01 02 0a 01 00 02 02 ma,dc=3Dde........
0020: 00 c8 02 01 00 01 01 00 a1 35 a4 0f 04 02 63 6e .........5....cn
0030: 30 09 80 07 6d c3 bc 6c 6c 65 72 a4 11 04 04 6d 0...m..ller....m
0040: 61 69 6c 30 09 80 07 6d c3 bc 6c 6c 65 72 a4 0f ail0...m..ller..
0050: 04 02 73 6e 30 09 80 07 6d c3 bc 6c 6c 65 72 30 ..sn0...m..ller0
0060: 0a 04 02 63 6e 04 04 6d 61 69 6c ...cn..mail
ber_get_next
So it still looks like everything is fine.
What came to my mind here was, "is the attribute mail allowed
to contain utf-8 chars by the schema?" but I could not solve that
question yet.
Let's see what happens next:
begin get_filter_list
begin get_filter
SUBSTRINGS
begin get_ssa
ber_scanf fmt ({m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e32 end=3D0x08256e73 len=3D65
0000:a4 0f 04 02 63 6e 30 0980 07 6d c3 bc 6c 6c 65 ....cn0...m..lle
0010:72 a4 11 04 04 6d 61 696c 30 09 80 07 6d c3 bc r....mail0...m..
0020:6c 6c 65 72 a4 0f 04 0273 6e 30 09 80 07 6d c3 ller....sn0...m.
0030:bc 6c 6c 65 72 30 0a 0402 63 6e 04 04 6d 61 69 .ller0...cn..mai
0040:6c l
ber_scanf fmt (m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e3a end=3D0x08256e73 len=3D57
0000:80 07 6d c3 bc 6c 6c 6572 a4 11 04 04 6d 61 69 ..m..ller....mai
0010:6c 30 09 80 07 6d c3 bc6c 6c 65 72 a4 0f 04 02 l0...m..ller....
0020:73 6e 30 09 80 07 6d c3bc 6c 6c 65 72 30 0a 04 sn0...m..ller0..
0030:02 63 6e 04 04 6d 61 696c .cn..mail
INITIAL
end get_ssa
Now it comes to scanf:
begin get_ssa
ber_scanf fmt ({m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e43 end=3D0x08256e73 len=3D48
0000:00 11 04 04 6d 61 69 6c30 09 80 07 6d c3 bc 6c ....mail0...m..l
0010:6c 65 72 a4 0f 04 02 736e 30 09 80 07 6d c3 bc ler....sn0...m..
0020:6c 6c 65 72 30 0a 04 0263 6e 04 04 6d 61 69 6c ller0...cn..mail
ber_scanf fmt (m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e4d end=3D0x08256e73 len=3D38
0000:80 07 6d c3 bc 6c 6c 6572 a4 0f 04 02 73 6e 30 ..m..ller....sn0
0010:09 80 07 6d c3 bc 6c 6c65 72 30 0a 04 02 63 6e ...m..ller0...cn
0020:04 04 6d 61 69 6c ..mail
error=3D21
end get_filter 0
error=3D21 shows up.
Finally let's the rest:
begin get_filter
SUBSTRINGS
begin get_ssa
ber_scanf fmt ({m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e56 end=3D0x08256e73 len=3D29
0000:00 0f 04 02 73 6e 30 0980 07 6d c3 bc 6c 6c 65 ....sn0...m..lle
0010:72 30 0a 04 02 63 6e 0404 6d 61 69 6c r0...cn..mail
ber_scanf fmt (m) ber:
ber_dump: buf=3D0x08256e08 ptr=3D0x08256e5e end=3D0x08256e73 len=3D21
0000:80 07 6d c3 bc 6c 6c 6572 30 0a 04 02 63 6e 04 ..m..ller0...cn.
0010:04 6d 61 69 6c .mail
INITIAL
end get_ssa
end get_filter 0
end get_filter_list
end get_filter 0
filter: (|(cn=3Dm\C3\BCller*)(?=3Dundefined)(sn=3Dm\C3\BCller*))
I hope the output will help here.
>
> I suggest you find out (e.g. by looking at logs with level "packets")
> what filter is actually sent; then check if the attribute is defined in
> your schema and if the value complies with the syntax of that attribute.
So let's have a closer look on the syntax of mail in the schema files
and how I've solved it:
I changed in core.schema
attributetype ( 0.9.2342.19200300.100.1.3
NAME ( 'mail' 'rfc822Mailbox' )
DESC 'RFC1274: RFC822 Mailbox'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
to
attributetype ( 0.9.2342.19200300.100.1.3
NAME ( 'mail' 'rfc822Mailbox' )
DESC 'RFC1274: RFC822 Mailbox'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
and now it works!
Thanks a lot for the right hint on the subject.
The issue can be closed.
Kind regards
Thomas Reifferscheid
--1569075624-1215372281-1151766743=:19714--