From owner-svn-src-head@freebsd.org Wed Dec 6 10:20:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFA91E9B846; Wed, 6 Dec 2017 10:20:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 271326C32C; Wed, 6 Dec 2017 10:20:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 0DE73854F; Wed, 6 Dec 2017 10:20:12 +0000 (UTC) Date: Wed, 6 Dec 2017 11:20:11 +0100 From: Baptiste Daroussin To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326617 - head/usr.sbin/newsyslog Message-ID: <20171206102011.klh3jbcrat6ucdxb@ivaldir.net> References: <201712060944.vB69iZQe027554@repo.freebsd.org> <20171206101535.GA8696@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qo3a332lamiodjvp" Content-Disposition: inline In-Reply-To: <20171206101535.GA8696@FreeBSD.org> User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 10:20:15 -0000 --qo3a332lamiodjvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 06, 2017 at 10:15:35AM +0000, Alexey Dokuchaev wrote: > On Wed, Dec 06, 2017 at 09:44:35AM +0000, Baptiste Daroussin wrote: > > New Revision: 326617 > > URL: https://svnweb.freebsd.org/changeset/base/326617 > >=20 > > Log: > > Allow newsyslog to execute compression commands which > > have a semantic different than the traditional gzip(1) > > =20 > > This is done to allow to use zstd(1) as a compression tool without > > having to patch it to change its default behavior. > >=20 > > Modified: > > head/usr.sbin/newsyslog/newsyslog.c > >=20 > > Modified: head/usr.sbin/newsyslog/newsyslog.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 06:49:53 2017 (r3266= 16) > > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 09:44:35 2017 (r3266= 17) > > @@ -151,14 +151,23 @@ struct compress_types { > > const char *flag; /* Flag in configuration file */ > > const char *suffix; /* Compression suffix */ > > const char *path; /* Path to compression program */ > > + char **args; /* Comrpession arguments */ >=20 > Comrpession? Fixed thanks >=20 > > + strlcpy(command, pgm_path, sizeof(command)); > > + for (c =3D 1; args[c] !=3D NULL; c++) { > > + strlcat(command, " ", sizeof(command)); > > + strlcat(command, args[c], sizeof(command)); > > + } >=20 > I'm wondering if we should check strlcpy/strlcat() return values here and > abort early if someone is trying to overrun command buffer? >=20 At worse we will have a truncated command to prompt in the debug/verbose informations, which imho is fine. Best regards, Bapt --qo3a332lamiodjvp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlonxFsACgkQY4mL3PG3 Plp0cA/7BiSj6ESTg+KjofanIIPMfywGk1g/Rq3fxRNVJGkRyjHzC04LqlU6dpMI h7YqLHsblbH763DEPxOtHhjK7EZFxINuaUTOxqsUai07wqaHGEH+HP38iUi7VvLb GhJNH5pZArsYNRITxbS7/qiwdmtIND/F5i90/MpwPH1zUFDkdE68rv55dggJFejw qnnBax1QfDgmPvanK1Fid6G6slFi/Vv++VGd8Up9gWgj9jQ5zDB4vFroEcpPDL5l 3bDPK33e8/LqL/XYdgN3k/f99pjzEX6180paT+QONg8SAZh7UNwN08LtbmuxbVIP brTVE+Hb0IiFDAWDJ0kAgu06wYv7SqaSIaeDtsKMtwHZxkN6PXp/xe5Itnt/8UZq Kie+98VkQ/F088Dv1oyP7ReBmkd7Ok2GcGat9j5TZ5HdxCovpeS5UqO4LV2GWNPq olCIzcNQlGd8V/iY0VvoXTTW4kFaofmxEfje+AcvbgzevldPRi0TwyaFvmvUY7Zo auFbkSgX5Qu31ZiC4MmF4B/plVmBWrnvJUa4OVefApd/5mCJDc0GoQy4W6i2fTcS jxAxG8n61fdhe7HnQ/cigw3LqZnKu+JuGh4EWgoTddIA+9OP1OLhVZ1pm6/KGdd3 QjakGgyxQBLo6VB/kA20tJprNoUCGR2eF5hpodVhs+aIYppECZ8= =UnYl -----END PGP SIGNATURE----- --qo3a332lamiodjvp--