A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=243 
====================================================================== 
Reported By:                dwheeler
Assigned To:                ajosey
====================================================================== 
Project:                    1003.1(2008)/Issue 7
Issue ID:                   243
Category:                   Shell and Utilities
Type:                       Enhancement Request
Severity:                   Objection
Priority:                   normal
Status:                     Under Review
Name:                       David A. Wheeler 
Organization:               IDA 
User Reference:              
Section:                    find 
Page Number:                2740 
Line Number:                89194 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2010-04-29 19:23 UTC
Last Modified:              2022-12-08 16:32 UTC
====================================================================== 
Summary:                    Add -print0 to "find"
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0000244 Add -0 to xargs
related to          0000245 Add -0 option to shell's "read"
has duplicate       0000903 Please, add find -print0, xargs -0, rea...
====================================================================== 

---------------------------------------------------------------------- 
 (0006093) stephane (reporter) - 2022-12-08 16:32
 https://austingroupbugs.net/view.php?id=243#c6093 
---------------------------------------------------------------------- 
One of the issues with find -print0 | xargs -0 cmd and that can make it
less safe than find -exec cmd {} + is that if find is killed for some
reason, or more generally if xargs' input is truncated, you may end up
passing the wrong path to cmd as current xargs implementation that support
-0 don't mandate the records be delimited.

For instance, a:

LC_ALL=C find /var/tmp -name '*.tmp' -type d -print0 |
  xargs -r0 rm -rf

Could end up running rm -rf /var if find gets killed (like because it
exceeded some resource limit) just after it has output of block that
happened to end on the /var or /var/.

I don't know if we can do anything about that as it's likely mandating the
0 delimiter could break some existing applications.

(that -r should also be added IMO). 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-04-29 19:23 dwheeler       New Issue                                    
2010-04-29 19:23 dwheeler       Status                   New => Under Review 
2010-04-29 19:23 dwheeler       Assigned To               => ajosey          
2010-04-29 19:23 dwheeler       Name                      => David A. Wheeler
2010-04-29 19:23 dwheeler       Organization              => IDA             
2010-04-29 19:23 dwheeler       Section                   => find            
2010-04-29 19:23 dwheeler       Page Number               => 2740            
2010-04-29 19:23 dwheeler       Line Number               => 89194           
2011-07-06 23:42 Don Cragun     Relationship added       related to 0000244  
2011-07-06 23:42 Don Cragun     Relationship added       related to 0000245  
2011-07-06 23:54 Don Cragun     Note Added: 0000882                          
2011-11-16 18:22 dwheeler       Note Added: 0001020                          
2015-03-12 16:15 Don Cragun     Relationship added       has duplicate 0000903
2022-12-08 15:39 geoffclare     Note Added: 0006091                          
2022-12-08 15:40 geoffclare     Note Edited: 0006091                         
2022-12-08 16:21 stephane       Note Added: 0006092                          
2022-12-08 16:23 stephane       Note Edited: 0006092                         
2022-12-08 16:32 stephane       Note Added: 0006093                          
======================================================================


  • [1003.1(2008... Austin Group Bug Tracker via austin-group-l at The Open Group
    • Re: Add... Stephane Chazelas via austin-group-l at The Open Group
      • Re:... Geoff Clare via austin-group-l at The Open Group
        • ... Steffen Nurpmeso via austin-group-l at The Open Group
        • ... Stephane Chazelas via austin-group-l at The Open Group
          • ... Geoff Clare via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
      • Re:... Stephane Chazelas via austin-group-l at The Open Group
        • ... Geoff Clare via austin-group-l at The Open Group
          • ... Stephane Chazelas via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to