svn commit: r326617 - head/usr.sbin/newsyslog

Baptiste Daroussin bapt at FreeBSD.org
Wed Dec 6 10:20:15 UTC 2017


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20171206/f62a9023/attachment.sig>


More information about the svn-src-all mailing list