Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Dec 2017 11:20:11 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Alexey Dokuchaev <danfe@FreeBSD.org>
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>
In-Reply-To: <20171206101535.GA8696@FreeBSD.org>
References:  <201712060944.vB69iZQe027554@repo.freebsd.org> <20171206101535.GA8696@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171206102011.klh3jbcrat6ucdxb>