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/



_______________________________________________
Bug-findutils mailing list
Bug-findutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-findutils

Reply via email to