Don't allow a wildcard address for the relay parameter.
This commit is contained in:
@@ -329,7 +329,8 @@ cb_iolog_maxseq(struct logsrvd_config *config, const char *str)
|
|||||||
|
|
||||||
/* Server callbacks */
|
/* Server callbacks */
|
||||||
static bool
|
static bool
|
||||||
append_address(struct server_address_list *addresses, const char *str)
|
append_address(struct server_address_list *addresses, const char *str,
|
||||||
|
bool allow_wildcard)
|
||||||
{
|
{
|
||||||
struct addrinfo hints, *res, *res0 = NULL;
|
struct addrinfo hints, *res, *res0 = NULL;
|
||||||
char *sa_str = NULL, *sa_host = NULL;
|
char *sa_str = NULL, *sa_host = NULL;
|
||||||
@@ -347,8 +348,11 @@ append_address(struct server_address_list *addresses, const char *str)
|
|||||||
if (!iolog_parse_host_port(copy, &host, &port, &tls, DEFAULT_PORT,
|
if (!iolog_parse_host_port(copy, &host, &port, &tls, DEFAULT_PORT,
|
||||||
DEFAULT_PORT_TLS))
|
DEFAULT_PORT_TLS))
|
||||||
goto done;
|
goto done;
|
||||||
if (host[0] == '*' && host[1] == '\0')
|
if (host[0] == '*' && host[1] == '\0') {
|
||||||
|
if (!allow_wildcard)
|
||||||
|
goto done;
|
||||||
host = NULL;
|
host = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(HAVE_OPENSSL)
|
#if !defined(HAVE_OPENSSL)
|
||||||
if (tls) {
|
if (tls) {
|
||||||
@@ -406,13 +410,13 @@ done:
|
|||||||
static bool
|
static bool
|
||||||
cb_listen_address(struct logsrvd_config *config, const char *str)
|
cb_listen_address(struct logsrvd_config *config, const char *str)
|
||||||
{
|
{
|
||||||
return append_address(&config->server.addresses.addrs, str);
|
return append_address(&config->server.addresses.addrs, str, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
cb_relay(struct logsrvd_config *config, const char *str)
|
cb_relay(struct logsrvd_config *config, const char *str)
|
||||||
{
|
{
|
||||||
return append_address(&config->server.relays.addrs, str);
|
return append_address(&config->server.relays.addrs, str, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
Reference in New Issue
Block a user