From 12498c5f9c17dc93bfa8a7d7a419466c823f9aa1 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 9 Apr 2003 09:16:01 +0000 Subject: [PATCH] Check that Host is set in ServerConnection and RouterConnection. --- apps/silcd/serverconfig.c | 8 ++++++++ doc/example_silcd.conf.in | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/silcd/serverconfig.c b/apps/silcd/serverconfig.c index e6da9f20..40e2bf0a 100644 --- a/apps/silcd/serverconfig.c +++ b/apps/silcd/serverconfig.c @@ -984,6 +984,10 @@ SILC_CONFIG_CALLBACK(fetch_server) /* check the temporary struct's fields */ if (!tmp) /* discard empty sub-blocks */ return SILC_CONFIG_OK; + if (!tmp->host) { + got_errno = SILC_CONFIG_EMISSFIELDS; + goto got_err; + } /* the temporary struct is ok, append it to the list */ SILC_SERVER_CONFIG_LIST_APPENDTMP(config->servers); @@ -1047,6 +1051,10 @@ SILC_CONFIG_CALLBACK(fetch_router) if (type == SILC_CONFIG_ARG_BLOCK) { if (!tmp) /* discard empty sub-blocks */ return SILC_CONFIG_OK; + if (!tmp->host) { + got_errno = SILC_CONFIG_EMISSFIELDS; + goto got_err; + } SILC_SERVER_CONFIG_LIST_APPENDTMP(config->routers); config->tmp = NULL; diff --git a/doc/example_silcd.conf.in b/doc/example_silcd.conf.in index 41426d40..20cc25c5 100644 --- a/doc/example_silcd.conf.in +++ b/doc/example_silcd.conf.in @@ -448,7 +448,8 @@ Admin { # If server connections are configured it means that this server is # router server. Normal servers must not configure server connections. # Thus, if this server is not router do not configure this section. If -# your server is router, this must be configured. +# your server is router, this must be configured. The Host (mandatory) +# specifies the remote server. # # The authentication data is specified by Passphrase and/or PublicKey. # If both are provided then both password and public key based authentication @@ -474,9 +475,9 @@ ServerConnection { # For normal servers only one entry maybe configured to this section. It # must be the router this server will be connected to. For router servers, # this section includes all configured router connections. The first -# configured connection is the primary route. The Host specifies the -# remote hostname or IP address. The Port specifies the remote port to -# connect when Initiator is true. When Initiator is false the Port +# configured connection is the primary route. The Host (mandatory) specifies +# the remote hostname or IP address. The Port specifies the remote port +# to connect when Initiator is true. When Initiator is false the Port # specifies the local port (listener port). # # The authentication data is specified by Passphrase and/or PublicKey. -- 2.43.0