[Dnssec-trigger] [PATCH] Allow strings longer than 2 characters for the HTTP probe
wouter at nlnetlabs.nl
Tue Jul 4 13:02:16 UTC 2017
Best regards, Wouter
On 04/07/17 14:50, Tomas Hozza wrote:
> Is there any chance that some will review this change and ideally merge it?
> Thank you.
> On 06.03.2017 12:11, Tomas Hozza wrote:
>> Previously only content of lenght 2 or less characters was allowed for
>> the HTTP probe. The length was hardcoded and even if the strings from
>> the configuration and from the probe matched, the result was failure.
>> This could be reproduced e.g. with using the following line in the
>> url: "http://httpstat.us/200 200 OK"
>> Signed-off-by: Tomas Hozza <thozza at redhat.com>
>> riggerd/http.c | 10 ++++++++--
>> 1 file changed, 8 insertions(+), 2 deletions(-)
>> diff --git a/riggerd/http.c b/riggerd/http.c
>> index a08d629..b68e898 100644
>> --- a/riggerd/http.c
>> +++ b/riggerd/http.c
>> @@ -767,11 +767,17 @@ static int
>> hg_check_data(ldns_buffer* data, char* result)
>> char* s = (char*)ldns_buffer_begin(data);
>> + size_t result_len = strlen(result);
>> - if(strncmp(s, result, strlen(result)) != 0)
>> + if(strncmp(s, result, result_len) != 0)
>> return 0;
>> - s += 2;
>> + /*
>> + * check that there is nothing else
>> + * than whitespaces after the expected string
>> + */
>> + s += result_len;
>> if(*s != 0)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the dnssec-trigger