[Dnssec-trigger] [PATCH] Allow strings longer than 2 characters for the HTTP probe

W.C.A. Wijngaards wouter at nlnetlabs.nl
Tue Jul 4 13:02:16 UTC 2017


Hi Tomas,

Sure, merged.

Best regards, Wouter

On 04/07/17 14:50, Tomas Hozza wrote:
> Hello.
> 
> Is there any chance that some will review this change and ideally merge it?
> 
> Thank you.
> 
> Regards,
> Tomas
> 
> 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
>> configuration:
>>
>> 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);
>> +
>>      while(isspace(*s))
>>          s++;
>> -    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;
>>      while(isspace(*s))
>>          s++;
>>      if(*s != 0)
>>
> 
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/dnssec-trigger/attachments/20170704/6e298b13/attachment.bin>


More information about the dnssec-trigger mailing list