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:		eab91d0081
Fixes:		2682a15527
MFC after:	1 week
Reviewed by:	jlduran, emaste
Differential Revision:	https://reviews.freebsd.org/D51536
This commit is contained in:
Dag-Erling Smørgrav
2025-07-26 18:44:35 +02:00
parent 150834f8fa
commit a7fa987abe
5 changed files with 9 additions and 6 deletions
+3
View File
@@ -51,6 +51,9 @@
# xargs -n1 | sort | uniq -d;
# done
# 20250726: Test case renamed
OLD_FILES+=usr/tests/usr.bin/xargs/regress.n2147483647.out
# 20250726: This file is now installed in /etc/dma
OLD_FILES+=usr/share/examples/dma/auth.conf