Bug 91229 - find: different results with and without "-ls"
Summary: find: different results with and without "-ls"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: findutils
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-20 07:16 UTC by Moritz Barsnick
Modified: 2007-04-18 16:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-05-20 07:19:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Moritz Barsnick 2003-05-20 07:16:29 UTC
Description of problem:
The program "find" gives me different results with and without the "-ls" flag, 
in terms of files found. I have only seen this once, in the noted situation.

Version-Release number of selected component (if applicable):
findutils-4.1.7-10
GNU find version 4.1.7

How reproducible:
only in this situation; maybe always under the correct circumstances, may need 
to provoke and check

Steps to Reproduce:
1. root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ -name "bcast*" -o -
name "broadcast*"
2. root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ -name "bcast*" -o -
name "broadcast*" -ls
3.
    
Actual results:
root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ -name "bcast*" -o -
name "broadcast*" 
SPECS/broadcast2000-sunshine.spec
SPECS/bcast.spec
SOURCES/broadcast2000-modif3.patch
SOURCES/broadcast2000-modif1.patch
SOURCES/broadcast2000-modif2.patch
SOURCES/bcast2000_final_src.tar.gz
SOURCES/bcast-2000c-src.tar.bz2
root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ -name "bcast*" -o -
name "broadcast*" -ls
989924    4 -rw-r--r--   1 root     root         2058 Jul  2  2000 
SPECS/broadcast2000-sunshine.spec
   640   24 -rw-r--r--   1 root     root        23017 Jul  2  2000 
SOURCES/broadcast2000-modif3.patch
    36   14 -rw-r--r--   1 root     root        14158 Jun 16  2000 
SOURCES/broadcast2000-modif1.patch
    37   16 -rw-r--r--   1 root     root        14824 Jun 16  2000 
SOURCES/broadcast2000-modif2.patch


Expected results:
something like this for the second find command (this is reconstructed 
with "|xargs ls"):
root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ -name "bcast*" -o -
name "broadcast*" | xargs ls -il
    536 -rw-rw-r--    1 barsnick barsnick  4918376 Jan 17  2001 SOURCES/bcast-
2000c-src.tar.bz2
     38 -rw-rw-r--    1 root     root      2574006 Jan 11  2000 
SOURCES/bcast2000_final_src.tar.gz
     36 -rw-r--r--    1 root     root        14158 Jun 16  2000 
SOURCES/broadcast2000-modif1.patch
     37 -rw-r--r--    1 root     root        14824 Jun 16  2000 
SOURCES/broadcast2000-modif2.patch
    640 -rw-r--r--    1 root     root        23017 Jul  2  2000 
SOURCES/broadcast2000-modif3.patch
 989391 -rw-r--r--    1 barsnick barsnick     4514 Jul 15  2001 SPECS/bcast.spec
 989924 -rw-r--r--    1 root     root         2058 Jul  2  2000 
SPECS/broadcast2000-sunshine.spec

Additional info:
Note the two files not listed by "find -ls" are owned by someone else (!=root). 
There may be some illegal uid checking in the "-ls" implementation?

Comment 1 Moritz Barsnick 2003-05-20 07:19:34 UTC
Aaaaaah darn darn darn! I tried to check it out for hours yesterday. Now (at 
work of all places!) I can see my mistake. "-ls" is only bound to the last "-
name" term, due to missing brackets.
root@sunshine:/usr/src/redhat # find SPECS/ SOURCES/ \( -name "bcast*" -o -
name "broadcast*" \) -ls
would have very very probably done the trick.
:-(
Sorry for the noise,
Moritz


Note You need to log in before you can comment on or make changes to this bug.