-/* $OpenBSD: config.c,v 1.48 2018/12/28 11:40:29 eric Exp $ */
+/* $OpenBSD: config.c,v 1.49 2018/12/28 14:21:02 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
set_local(conf, conf->sc_hostname);
t = table_create(conf, "static", "<anydestination>", NULL);
- t->t_type = T_LIST;
table_add(t, "*", NULL);
hostname[strcspn(hostname, ".")] = '\0';
struct table *t;
t = table_create(conf, "static", "<localnames>", NULL);
- t->t_type = T_LIST;
table_add(t, "localhost", NULL);
table_add(t, hostname, NULL);
-/* $OpenBSD: parse.y,v 1.249 2018/12/28 11:40:29 eric Exp $ */
+/* $OpenBSD: parse.y,v 1.250 2018/12/28 14:21:02 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
keyval : STRING assign STRING {
- table->t_type = T_HASH;
table_add(table, $1, $3);
free($1);
free($3);
;
stringel : STRING {
- table->t_type = T_LIST;
table_add(table, $1, NULL);
free($1);
}
struct table *t;
t = table_create(conf, "static", NULL, NULL);
- t->t_type = T_LIST;
table_add(t, $1, NULL);
free($1);
$$ = t;
-/* $OpenBSD: table_static.c,v 1.31 2018/12/28 11:11:36 eric Exp $ */
+/* $OpenBSD: table_static.c,v 1.32 2018/12/28 14:21:02 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
if (*table->t_config)
return 0;
+ if (table->t_type == T_NONE)
+ table->t_type = val ? T_HASH : T_LIST;
+ else if (table->t_type == T_LIST && val)
+ return 0;
+ else if (table->t_type == T_HASH && val == NULL)
+ return 0;
+
if (priv == NULL) {
if (table_static_config(table) == 0)
return 0;