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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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 > > > > Log: > > Allow newsyslog to execute compression commands which > > have a semantic different than the traditional gzip(1) > > > > This is done to allow to use zstd(1) as a compression tool without > > having to patch it to change its default behavior. > > > > Modified: > > head/usr.sbin/newsyslog/newsyslog.c > > > > Modified: head/usr.sbin/newsyslog/newsyslog.c > > ============================================================================== > > --- head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 06:49:53 2017 (r326616) > > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 09:44:35 2017 (r326617) > > @@ -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 */ > > Comrpession? Fixed thanks > > > + strlcpy(command, pgm_path, sizeof(command)); > > + for (c = 1; args[c] != NULL; c++) { > > + strlcat(command, " ", sizeof(command)); > > + strlcat(command, args[c], sizeof(command)); > > + } > > I'm wondering if we should check strlcpy/strlcat() return values here and > abort early if someone is trying to overrun command buffer? > At worse we will have a truncated command to prompt in the debug/verbose informations, which imho is fine. Best regards, Bapt [-- Attachment #2 --] -----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-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171206102011.klh3jbcrat6ucdxb>
