From nobody Thu Jun 23 12:13:59 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8666A863409 for ; Thu, 23 Jun 2022 12:13:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LTK132L9Lz3v02 for ; Thu, 23 Jun 2022 12:13:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 304631AD92 for ; Thu, 23 Jun 2022 12:13:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 25NCDxfS060404 for ; Thu, 23 Jun 2022 12:13:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25NCDxTb060403 for bugs@FreeBSD.org; Thu, 23 Jun 2022 12:13:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264846] xargs should terminate if line replacement cannot be constructed Date: Thu, 23 Jun 2022 12:13:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: thj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: exp-run? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655986439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yU1sh5HUkQ2A8ATJIOWpAgh517lguDof6NWSMApmdoQ=; b=p5VmC3z535h84vpfRo1OqLme9D/VP0BnTai7lR0txqF8TRJNdQQKBONecH0JDTYBaaYIxe 4UVMTq+2G+1le8O92vOAdHpUJyUFH3m7O2KRK4YXqoITaLw6zwLkVUcLF/SxmpfM7VrJY/ Irsv1oXKAwg1zK+ChKFCgWKIylyE+G79Ob9FKmxHS4zQYjgN2g+fQqO37wPlproTpRuHxz In38p5m9JhB5geV5mxbluQ/Eu3lpTzlDOIWaqyO9/2E0c1HnYH/3jt+W+6QII/M44cZflm um42SmcMWrTjpGjEyKl66pRhl2uPBlYy+G6BvXgTuQj0nXXGvndXR85CGCFkfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655986439; a=rsa-sha256; cv=none; b=VOonxcI1+3a7fhuD3ZKod9jAyvaaFlPdVkTYmAsXp0rIphZP49Sa/AW2BSKeQE4Cr64/dS IekvVFceeoCAqcmIrfwhSQIF1sdsgoKk8qunhLF0ELKCvz9wcBSsMTOs/ukjwAqC+w22VR KUd6Tk9g5g/TWX8EAC7GGw4+giwD05ftSJwhN3PhBjZv8A7pIpcJJnNch86WSneLQoNiD2 wCrM5+REwlFK74taci+ARDb1EuIPnDAYuQx02SRwubQM/a9Z07hmTiPvE6DtjZDpelv6nq eKQpfME/G++tE7qSMuz/oDwXlbZhv6MrM9odiomWlkTl38YA1w5fTiqQlQx54g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264846 Bug ID: 264846 Summary: xargs should terminate if line replacement cannot be constructed Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: thj@FreeBSD.org Flags: exp-run? Created attachment 234885 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D234885&action= =3Dedit cause xargs to error if line cannot be constructed https://reviews.freebsd.org/D35574 If the line with replacement cannot be constructed xargs should terminate as documented in the man page: -I replstr=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Execute utility for each input line, replacing one or more=20=20=20= =20=20=20=20 occurrences of replstr in up to replacements (or 5 if no -R flag=20 is specified) arguments to utility with the entire line of input. The resulting arguments, after replacement is done, will not be=20= =20 allowed to grow beyond replsize (or 255 if no -S flag is=20=20=20= =20=20=20=20=20=20 specified) bytes; this is implemented by concatenating as much of the argument containing replstr as possible, to the constructed=20= =20 arguments to utility, up to replsize bytes. The size limit does=20 not apply to arguments to utility which do not contain replstr,=20= =20 and furthermore, no replacement will be done on utility itself.=20= =20 Implies -x. Currently, xargs continues and lines that cannot accommodate the replacement get as much of the replstr as will fit in the string. Instead xargs should erro= r, include an error when we do. We encounter this error, but gnu/xargs doesn't because they have a much lar= ger limit for created outputs (~10000 lines). --=20 You are receiving this mail because: You are the assignee for the bug.=