bugfindutils - Bugs: bug #20688, 'find / -nowarn -maxdepth 0 -name...

 
 

bug #20688: 'find / -nowarn -maxdepth 0 -name /' still warns

Submitted by:  Eric Blake <ericb>
Submitted on:  Sat 04 Aug 2007 09:29:17 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: Eric Blake <ericb>
Originator Name: Eric BlakeOpen/Closed: Closed
Release: 4.2.21Fixed Release: 4.3.9

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 05 Aug 2007 03:29:41 AM UTC, comment #2:

In the process of fixing bug #20662, I ended up patching this first in order to add a test to the testsuite without tripping over the warning.

My patch stuck with the existing simpler approach of warning if / appears anywhere in the -name argument, rather than filtering on the special cases of '-name /' or '-name //', since those are rare in practice.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Sat 04 Aug 2007 09:36:29 PM UTC, comment #1:

Agree the warning should be suppressible. When the warning is not suppressed it should not be issued anyway for "/", being the one case where there will be a match.

James Youngman <jay>
Project Administrator
Sat 04 Aug 2007 09:29:17 PM UTC, original submission:

The warning issued by -name when the pattern includes '/' is not mentioned in find.texi, either as a suppressable warning or as a severe warning. I think it should be suppressable, because as the following command line shows, it is only a warning and not a hard fact that -name / usually results in no matches:

$ find / -nowarn -maxdepth 0 -name /
find: warning: Unix filenames usually don't contain slashes (though pathnames do). That means that '-name `/'' will probably evaluate to false all the time on this system. You might find the '-wholename' test more useful, or perhaps '-samefile'. Alternatively, if you are using GNU grep, you could use 'find ... -print0 | grep -FzZ `/''.
/

Either way, whether we change parser.c to let -nowarn suppress this warning or not, we also need to document this warning in find.texi.

Eric Blake <ericb>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 11 Nov 2007 07:47:09 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.9
    Tue 04 Sep 2007 03:03:09 PM UTCericbDependencies-=>bugs #20970 is dependent
    Sun 05 Aug 2007 12:22:20 PM UTCericbStatusIn Progress=>Fixed
    Sun 05 Aug 2007 03:29:41 AM UTCericbStatusNone=>In Progress
      Assigned toNone=>ericb

    Back to the top


    Powered by Savane 3.1-cleanup1