change this in all config parsers in our tree that support macros.
problem reported by sven falempin.
feedback from henning@, stsp@, deraadt@
ok florian@ mikeb@
-/* $OpenBSD: parse.y,v 1.54 2015/12/09 21:41:49 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.55 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
varset : STRING '=' string
{
+ char *s = $1;
log_debug("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.164 2015/12/09 21:41:50 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.165 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
varset : STRING '=' string
{
+ char *s = $1;
if (ipsec->opts & IPSECCTL_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.651 2016/06/21 13:40:43 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.652 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
;
varset : STRING '=' varstring {
+ char *s = $1;
if (pf->opts & PF_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable %s", $1);
free($1);
-/* $OpenBSD: parse.y,v 1.287 2016/06/03 17:36:37 benno Exp $ */
+/* $OpenBSD: parse.y,v 1.288 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (cmd_opts & BGPD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.29 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.30 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (conf->opts & DVMRPD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.15 2016/06/05 03:36:41 renato Exp $ */
+/* $OpenBSD: parse.y,v 1.16 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (global.cmd_opts & EIGRPD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.50 2015/08/20 22:39:29 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.51 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
varset : STRING '=' string
{
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
hostapd_fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.77 2015/11/22 13:27:13 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.78 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.37 2016/01/29 02:22:57 mmcc Exp $ */
+/* $OpenBSD: parse.y,v 1.38 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (conf->opts & IFSD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1) {
free($1);
free($3);
-/* $OpenBSD: parse.y,v 1.7 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.8 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.17 2016/05/01 00:32:37 jmatthew Exp $ */
+/* $OpenBSD: parse.y,v 1.18 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.55 2016/06/18 01:33:02 renato Exp $ */
+/* $OpenBSD: parse.y,v 1.56 2016/06/21 21:35:24 benno Exp $ */
/*
* Copyright (c) 2013, 2015, 2016 Renato Westphal <renato@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (global.cmd_opts & LDPD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.27 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.28 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
| NO { $$ = 1; }
varset : STRING '=' string {
+ char *s = $1;
if (conf->opts & OSPFD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.80 2015/12/05 12:20:13 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.81 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
;
varset : STRING '=' string {
+ char *s = $1;
if (conf->opts & OSPFD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.206 2015/11/22 13:27:13 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.207 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.34 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.35 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
| NO { $$ = 1; }
varset : STRING '=' string {
+ char *s = $1;
if (conf->opts & RIPD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.184 2016/04/21 14:27:41 jsing Exp $ */
+/* $OpenBSD: parse.y,v 1.185 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.38 2015/11/22 13:27:13 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.39 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.6 2016/03/13 13:11:47 stefan Exp $ */
+/* $OpenBSD: parse.y,v 1.7 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2007-2015 Reyk Floeter <reyk@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatalx("cannot store variable");
free($1);
-/* $OpenBSD: parse.y,v 1.18 2015/01/16 06:40:22 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.19 2016/06/21 21:35:25 benno Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
;
varset : STRING '=' STRING {
+ char *s = $1;
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
fatal("cannot store variable");
free($1);