HomeFreeBSD

xargs: Limit -n to {ARG_MAX}

Description

xargs: Limit -n to {ARG_MAX}

Since it's not possible to pass more than {ARG_MAX} bytes on the command
line, it's also not possible to pass more than {ARG_MAX} individual
arguments. Therefore, {ARG_MAX} is a reasonable upper bound for the -n
option. This resolves both the arithmetic overflow issue and the CI OOM
issue, so we can safely re-enable the test.

Fixes: eab91d008165
Fixes: 2682a1552724
MFC after: 1 week
Reviewed by: jlduran, emaste
Differential Revision: https://reviews.freebsd.org/D51536

Details

Provenance
desAuthored on Jul 26 2025, 4:44 PM
Reviewer
jlduran
Differential Revision
D51536: xargs: Limit -n to {ARG_MAX}
Parents
rG150834f8fa57: sys/geom: use proper style for sizeof operator
Branches
Unknown
Tags
Unknown