Summary: | sys-libs/uclibc-0.9.33.2-r14 and -0.9.33.9999: broken implementation of fnmatch() | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | René Rhéaume <rene.rheaume> |
Component: | [OLD] Core system | Assignee: | Embedded Gentoo Team <embedded> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=181275 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 570544 | ||
Attachments: |
emerge --info output
build.log tests/test-suite.log from work directory tests/unit-tests.log from work directory |
Description
René Rhéaume
2014-11-02 00:18:27 UTC
Created attachment 388290 [details]
emerge --info output
Created attachment 388292 [details]
build.log
% emerge -pqv '=net-misc/wget-1.16::gentoo' [ebuild U ] net-misc/wget-1.16 [1.14] USE="-debug -gnutls -idn ipv6 (-nls) -ntlm pcre ssl -static -uuid zlib" Created attachment 388294 [details]
tests/test-suite.log from work directory
Created attachment 388296 [details]
tests/unit-tests.log from work directory
Comment on attachment 388296 [details]
tests/unit-tests.log from work directory
Text already included in test-suite.log
The failure is in src/utils.c, in test_dir_matches_p(void), line 2528: { { "*COMPLETE", NULL, NULL }, "foo/!COMPLETE", false } and 2539: bool res = dir_matches_p (test_array[i].dirlist, test_array[i].dir); which checks test_array[i].dirlist = { "*COMPLETE", NULL, NULL } for an instance of test_array[i].dir = "foo/!COMPLETE" and expects a false return but gets true. This is because of the line 975 which reads: if (matcher (p, dir, FNM_PATHNAME) == 0) where matcher is set to either fnmatch or fnmatch_nocase. Reducing the code down we have the following test code: #include <stdio.h> #include <fnmatch.h> int main() { int res = fnmatch("*COMPLETE", "foo/!COMPLETE", FNM_PATHNAME); printf("res = %d\n", res); } On glibc this returns "res = 1" whereas on uclibc this returns "res = 0". This was tested on uclibc-0.9.33.9999. which is the head of the 0.3.33 branch. (In reply to Anthony Basile from comment #7) > [...] Reducing the code > down we have the following test code: > > #include <stdio.h> > #include <fnmatch.h> > > int main() { > int res = fnmatch("*COMPLETE", "foo/!COMPLETE", FNM_PATHNAME); > printf("res = %d\n", res); > } > > On glibc this returns "res = 1" whereas on uclibc this returns "res = 0". > This was tested on uclibc-0.9.33.9999. which is the head of the 0.3.33 > branch. According to http://pubs.opengroup.org/stage7tc1/functions/fnmatch.html , glibc is correct because it returns a non-match when options contains FNM_PATHNAME and slash is not in both strings. So this is a bug in uclibc. After doing a quick search with "uclibc" as the search term, this bug looks like a duplicate of bug #181275 , an old bug indeed. Removed from the tree |