[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bizzare bug in find, potential security implications

From: Bernhard Voelker
Subject: Re: Bizzare bug in find, potential security implications
Date: Thu, 21 Dec 2017 16:22:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 12/21/2017 01:12 PM, Dale R. Worley wrote:
Yes, this is one of those situations where you have to define very
exactly what it is that you're trying to do.  In the case of the OP, the
question is really whether the final four octets of the file name are
'.exe' regardless of what the preceding octets are.  In that case, you
want LC_ALL=C to prevent the software from trying to be clever about
character strings:

$ LC_ALL=C find htdocs -type f -iregex '.*\.exe$'

As the OPs case just needs matches for the suffix of the basename,
I'd personally always go with good old -name:

   find htdocs -type f -name '*.exe'

Have a nice day,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]