bug-findutils
[Top][All Lists]
Advanced

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

[bug #16738] find does not subtract environment size from ARG_MAX


From: Geoff Clare
Subject: [bug #16738] find does not subtract environment size from ARG_MAX
Date: Fri, 2 Jun 2006 16:52:49 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050517 Firefox/1.0.4 (Debian package 1.0.4-2)

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16738>

                 Summary: find does not subtract environment size from
ARG_MAX
                 Project: findutils
            Submitted by: geoffclare
            Submitted on: Friday 06/02/2006 at 16:52
                Category: find
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Geoff Clare
        Originator Email: 
             Open/Closed: Open
                 Release: 4.2.27
           Fixed Release: None

    _______________________________________________________

Details:

In xargs.c there is the following code:

  /* Take the size of the environment into account.  */
  if (size_of_environment > posix_arg_size_max)
    {
      bc_ctl.arg_max = 0;
      env_too_big = 1;
    }
  else
    {
      bc_ctl.arg_max = posix_arg_size_max - size_of_environment;
    }

The equivalent code is missing from find.  This means that if
the environment passed to find is too large, it can produce
exec() errors when "{} +" is used:

$ env | wc -c
    1953
$ find . -exec true {} +
$ FOO=$(printf '%1024s' x) env | wc -c
    2982
$ FOO=$(printf '%1024s' x) find . -exec true {} +   
find: true: Argument list too long
find: true: Argument list too long







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16738>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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