diff options
author | brian <brian@FreeBSD.org> | 2001-04-10 23:16:55 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-04-10 23:16:55 +0000 |
commit | e47f3b7b9f4479e296e2ee927b7e08891474a521 (patch) | |
tree | 67646ad053dde684609cc776eab539222fb5d49a /usr.bin | |
parent | 3a77bccdbb6eaa568816dcadf605b46cc8089b03 (diff) | |
download | FreeBSD-src-e47f3b7b9f4479e296e2ee927b7e08891474a521.zip FreeBSD-src-e47f3b7b9f4479e296e2ee927b7e08891474a521.tar.gz |
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.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/xargs/xargs.1 | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/xargs/xargs.1 b/usr.bin/xargs/xargs.1 index b7f4cdb..671edc3 100644 --- a/usr.bin/xargs/xargs.1 +++ b/usr.bin/xargs/xargs.1 @@ -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 . |