X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnetwork.c;h=b5f3d4893abcd63d49e249fde0fdbb328bec6096;hb=f70935ddfb05b03de6e6dff95d842cb7c553e8b9;hp=8caeb6384655493b463de52a67b70785deea46da;hpb=865f2eb31e8264edd9337bc63ac59f6c2fa3b5a7;p=collectd.git diff --git a/src/network.c b/src/network.c index 8caeb638..b5f3d489 100644 --- a/src/network.c +++ b/src/network.c @@ -1003,14 +1003,6 @@ static int parse_part_sign_sha256(sockent_t *se, /* {{{ */ buffer_len = *ret_buffer_len; buffer_offset = 0; - if (se->data.server.userdb == NULL) { - c_complain( - LOG_NOTICE, &complain_no_users, - "network plugin: Received signed network packet but can't verify it " - "because no user DB has been configured. Will accept it."); - return (0); - } - /* Check if the buffer has enough data for this structure. */ if (buffer_len <= PART_SIGNATURE_SHA256_SIZE) return (-ENOMEM); @@ -1027,6 +1019,18 @@ static int parse_part_sign_sha256(sockent_t *se, /* {{{ */ return (-1); } + if (se->data.server.userdb == NULL) { + c_complain( + LOG_NOTICE, &complain_no_users, + "network plugin: Received signed network packet but can't verify it " + "because no user DB has been configured. Will accept it."); + + *ret_buffer = buffer + pss_head_length; + *ret_buffer_len -= pss_head_length; + + return (0); + } + /* Copy the hash. */ BUFFER_READ(pss.hash, sizeof(pss.hash)); @@ -3223,5 +3227,3 @@ void module_register(void) { plugin_register_flush("network", network_flush, /* user_data = */ NULL); } /* void module_register */ - -/* vim: set fdm=marker : */