Bug 531 - fnmatch on MacOS X (and other BSD OSes) doesn't accept character classes
fnmatch on MacOS X (and other BSD OSes) doesn't accept character classes
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Configure
1.8.3
Macintosh MacOS X
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-21 18:22 MST by bowman+sudo
Modified: 2012-02-21 06:11 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bowman+sudo 2011-12-21 18:22:05 MST
The fnm_test fails because fnmatch on MacOS X 10.5 doesn't support character classes.  The failure is:

fnmatch: /bin/[[:opper:][:alnum:]]* /bin/ls 0: want 1, got 2
fnmatch: 5 tests run, 1 errors, 80% success rate

From the MacOS X fnmatch(3) man page:
STANDARDS
     The current implementation of the fnmatch() function does not conform to
     IEEE Std 1003.2 (``POSIX.2'').  Collating symbol expressions, equivalence
     class expressions and character class expressions are not supported.
Comment 1 Todd C. Miller 2012-01-16 10:43:16 MST
You should really file a bug with Apple.  I added support for character classes in the BSD fnmatch and glob functions a few years ago in OpenBSD (and in the versions shipped with sudo).

However, I've made a change to only run the regression tests in the compat dir when we are using the functions shipped with sudo and not against the system versions.  That will quiet "make check" on MacOS X.