o The -s limit is ARG_MAX - 4K, not ARG_MAX - 2K.

o Mention that the current environment is part of the -s calculation.
o Add a BUGS section that warns against executing a program that increases
  the size of the argument list or the size of the environment.

  I have wondered for a while what the difference is between

    get a big list | xargs sudo command

  which fails and

    get a big list | sudo xargs command

  which succeeds.  The answer is that in the first case, sudo expands
  the environment and pushes the amount of data passed into execve over
  the E2BIG threshold.
This commit is contained in:
Brian Somers 2001-04-10 23:16:55 +00:00
parent 5f76d89870
commit c42584e853
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75398

View file

@ -112,16 +112,17 @@ is 5000.
.It Fl s Ar size
Set the maximum number of bytes for the command line length provided to
.Ar utility .
The sum of the length of the utility name and the arguments passed to
The sum of the length of the utility name, the arguments passed to
.Ar utility
(including
.Dv NULL
terminators) will be less than or equal to this number.
terminators) and the current environment will be less than or equal to
this number.
The current default value for
.Ar size
is
.Dv ARG_MAX
- 2048.
- 4096.
.It Fl t
Echo the command to be executed to standard error immediately before it
is executed.
@ -164,10 +165,19 @@ If any other error occurs,
exits with a value of 1.
.Sh SEE ALSO
.Xr echo 1 ,
.Xr find 1
.Xr find 1 ,
.Xr execvp 3
.Sh STANDARDS
The
.Nm
utility is expected to be
.St -p1003.2
compliant.
.Sh BUGS
If
.Ar utility
attempts to envoke another command such that the number of arguments or the
size of the environment is increased, it risks
.Xr execvp 3
failing with
.Dv E2BIG .