Hide Forgot
Created attachment 548372 [details] tar file that demonstrates the bug Description of problem: tar 1.23 (RHEL 6.2) does not extract files that contain characters that do not match the current locale. It only happens if a directory is given that is to be extracted. Version-Release number of selected component (if applicable): tar 1.23 How reproducible: Always Steps to Reproduce: 1. Call "tar xf 100.tar 100" to extract directory "100" from attached tar file 2. 3. Actual results: One only obtains "100/file2a" and "100/md5sums" but not file "100/file1ä". When called with "tar xf 100.tar" without specifying a directory, all three files are extracted. It seems that pattern matching fails for the file containing the ISO8859-1 character when tar is run in an UTF-8 environment. Expected results: All 3 files should be extracted. Additional info: tar 1.15.1 (RHEL 5.7) and tar 1.26 (Upstream) work correctly and extract all three files.
This behavior is caused by the implementation of fnmatch() from glibc. A possible fix would be to switch tar to use the fnmatch implementation from gnulib, which is already there but not used. Luckily, in your case you do not use the wildcard matching anyway. So I would suggest to just disable the wildcard matching by the --no-wildcards option. Note that --no-wildcards is now the default behavior in the upstream tar.
Thanks Kamil. I was not even aware of wildcard matching being used in my case. Since for me a workaround exists, I can deal with this behavior of tar. It may however break existing scripts that are not that simple to fix.
Created attachment 555480 [details] proposed fix Sync the assertions about working fnmatch() with up2date tar. This patch causes the autoconf checks to detect the fnmatch() implementation from RHEL-6 glibc as broken and use the fnmatch() implementation from gnulib instead.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0849.html