From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B5C53858436; Sat, 18 Nov 2023 11:53:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B5C53858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700308413; bh=vP5Ke2Y2YBXWVoGSyAVYxSdvaFTLDKe3ZhWs/ahiq54=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Dl9An+4EXnDdEs0HrlcM1TZ04De7LxhhFsOiaKsx9c9aleQHO/0/klmuKRTHSkvcs 4AzKztzaPMhUiiWo1DYj4Jh0VV4XkjuIuzbP8YIxqHB8ZFBdCWxsafEGii//ei5H8y e+NGPkkLXGzYo/YnLYS/NQnrMAlAK0Zuqbxx8ypY= From: "stephane+sourceware at chazelas dot org" To: glibc-bugs@sourceware.org Subject: [Bug glob/31075] fnmatch("??") matches on 2-byte single characters (as well as 2 any-length characters) Date: Sat, 18 Nov 2023 11:53:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: glob X-Bugzilla-Version: 2.34 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stephane+sourceware at chazelas dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31075 --- Comment #1 from Stephane Chazelas --- (In reply to Stephane Chazelas from comment #0) > Regression introduced in 2.34 by commit > a79328c745219dcb395070cdcd3be065a8347f24 reproduced on Ubuntu 22.04, Deb= ian > sid libc6:amd64 2.37-12, and current git HEAD > (dae3cf4134d476a4b4ef86fd7012231d6436c15e) built on that sid system. >=20 > find . -name '??' [...] To clarify, "find" is used here to demonstrate the behaviour of the libc's fnmatch(). Here with GNU find. $ LD_DEBUG=3Dbindings find =C3=A9 -name '??' |& grep fnmatch 323895: binding file /lib/x86_64-linux-gnu/libselinux.so.1 [0] to /lib/x86_64-linux-gnu/libc.so.6 [0]: normal symbol `fnmatch' [GLIBC_2.2.5] 323895: binding file find [0] to /lib/x86_64-linux-gnu/libc.so.6 [0= ]: normal symbol `fnmatch' [GLIBC_2.2.5] $ ltrace -e 'fnmatch' find =C3=A9 =C3=A9=C3=A9 $'\U10FFFF\U10FFFF' -name '?= ?' find->fnmatch("foo", "foo", 0)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 =3D 0 find->fnmatch("Foo", "foo", 0)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 =3D 1 find->fnmatch("Foo", "foo", 16)=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 =3D 0 find->fnmatch("??", "\303\251", 0)=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 =3D 0 =C3=A9 find->fnmatch("??", "\303\251\303\251", 0)=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20 =3D 0 =C3=A9=C3=A9 find->fnmatch("??", "\364\217\277\277\364\217\277\277", 0)=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =3D 0 ?? +++ exited (status 0) +++ (here showing ?? matching one 2-byte character, two 2-byte characters and t= wo 4-byte characters). --=20 You are receiving this mail because: You are on the CC list for the bug.=