bugfindutils - Bugs: bug #52890, `find --name` ignores files with...


bug #52890: `find --name` ignores files with non-printable character in the filename

Submitted by:  None
Submitted on:  Sun 14 Jan 2018 11:35:30 PM UTC  
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  H.-Dirk Schmitt Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  4.6.0
Fixed Release:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 15 Jan 2018 03:54:34 PM UTC, comment #3: 

You've discovered a fundamental flaw in the specification of the glob() function - it is only required to have well-defined behavior on byte strings that are valid encodings in the current locale.  There is no portable way to make glob patterns match file names that contain encoding errors in a multibyte locale.  But what you CAN do is specify 'LC_ALL=C find' for any situation where you want to ensure that globs cannot fail due to encoding errors, because the C locale is guaranteed by POSIX to be a single-byte 8-bit-clean locale (thus, no encoding errors are possible in that locale, and glob() no longer has to worry about failure to match a byte string that is not a valid character string).

Eric Blake <ericb>
Project Administrator
Sun 14 Jan 2018 11:55:52 PM UTC, comment #2: 

I give up :-(

asterisk ERR asterisk

Sun 14 Jan 2018 11:54:49 PM UTC, comment #1: 

Sorry markup has rotten the report  - it shoud be:
`find -name '*ERR*' '

Sun 14 Jan 2018 11:35:30 PM UTC, original submission:  

See also https://bugs.launchpad.net/ubuntu/+source/findutils/+bug/1742011

Affected:  4.6.0 in xenial, artful, bionic
bionic version is 4.6.0+git+20170828

Simple test case:
touch $(echo -e ERR'\0303'OR )
find . -name "*ERR*"

Result is that only the file NON_ERROR is shown and the file with the non-printable character ERR?OR is missing.

`find .` (without -name) show both files.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.5