[Top][All Lists]

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

[bug #18320] Zero bytes in input should give warning

From: Ed Avis
Subject: [bug #18320] Zero bytes in input should give warning
Date: Fri, 17 Nov 2006 17:15:04 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0


                 Summary: Zero bytes in input should give warning
                 Project: findutils
            Submitted by: epaepa
            Submitted on: Friday 17/11/06 at 17:15
                Category: xargs
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 4.2.27
           Fixed Release: None



In Unix, command line arguments passed to a process are NUL-terminated.  So
it is not possible for an argument string to contain a NUL character.  xargs
ought to warn about this.  To reproduce:

% perl -e 'print "a", chr(0), "b"' | xargs echo

Actual result: echo prints 'a' on the console

Desired result: xargs gives a warning something like

NUL character found in input, cannot be passed through to argument list (did
you mean to use the -0 flag?)

For backwards compatibility, xargs could do what it effectively does now and
truncate the argument at the first NUL byte.  But it shouldn't do so

More exotic solutions would be to strip out the NULs, or treat them as
whitespace, but I don't think this is justified.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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