From owner-cvs-src@FreeBSD.ORG Mon Oct 18 15:40:48 2004
Return-Path: <owner-cvs-src@FreeBSD.ORG>
Delivered-To: cvs-src@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
by hub.freebsd.org (Postfix) with ESMTP
id F04E616A4CE; Mon, 18 Oct 2004 15:40:47 +0000 (GMT)
Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115])
by mx1.FreeBSD.org (Postfix) with ESMTP
id E078543D39; Mon, 18 Oct 2004 15:40:47 +0000 (GMT)
(envelope-from cperciva@FreeBSD.org)
Received: from repoman.freebsd.org (localhost [127.0.0.1])
by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9IFel7j088002;
Mon, 18 Oct 2004 15:40:47 GMT
(envelope-from cperciva@repoman.freebsd.org)
Received: (from cperciva@localhost)
by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9IFelfE088001;
Mon, 18 Oct 2004 15:40:47 GMT
(envelope-from cperciva)
Message-Id: <200410181540.i9IFelfE088001@repoman.freebsd.org>
From: Colin Percival <cperciva@FreeBSD.org>
Date: Mon, 18 Oct 2004 15:40:47 +0000 (UTC)
To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org,
cvs-all@FreeBSD.org
X-FreeBSD-CVS-Branch: HEAD
Subject: cvs commit: src/usr.bin/xargs strnsubst.c
X-BeenThere: cvs-src@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: CVS commit messages for the src tree <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Oct 2004 15:40:48 -0000
cperciva 2004-10-18 15:40:47 UTC
FreeBSD src repository
Modified files:
usr.bin/xargs strnsubst.c
Log:
Modify behaviour of `xargs -I` in order to:
1. Conform to IEEE Std 1003.1-2004, which state that "Constructed
arguments cannot grow larger than 255 bytes", and
2. Avoid a buffer overflow.
Unfortunately the standard doesn't indicate how xargs is supposed to
handle arguments which (with the appropriate substitutions) would grow
larger than 255 bytes; this solution handles those by making as many
substitutions as possible without overflowing the buffer.
OpenBSD's xargs resolves this in a different direction, by making
all the substitutions and then silently truncating the resulting string.
Since this change may break existing scripts which rely upon the buffer
overflow (255 bytes isn't really all that long...) it will not be MFCed.
Revision Changes Path
1.7 +2 -2 src/usr.bin/xargs/strnsubst.c