[rrd-developers] PATCH: Fix strange sql// filename handling

Martin Sperl rrdtool at martin.sperl.org
Fri Mar 4 17:58:54 CET 2011


Actually the code was intended to allow the options to use "::" or any other "double" separator instead of // as well... 
But as this behavior is not documented, it is good to avoid this possible conflict.

Ciao,
		Martin


On 03.03.2011, at 07:56, Tobias Oetiker wrote:

> Hi Peter,
> 
> thanks for the patch ... integrated
> 
> cheers
> tobi
> Yesterday Peter Stamfest wrote:
> 
>> 
>> Hi!
>> 
>> This fixes some strange file name handling wrt libdbi.
>> 
>> The original code would identify a file named "sqlxxabc.rrd" as a libdbi
>> specification, if I read the code right.
>> 
>> I found this when browsing the source code, so both the bug and the fix are
>> untested.
>> 
>> Patch is both inlined and attached:
>> 
>> 
>> 
>> Index: src/rrd_fetch.c
>> ===================================================================
>> --- src/rrd_fetch.c    (revision 2175)
>> +++ src/rrd_fetch.c    (working copy)
>> @@ -240,10 +240,8 @@
>> 
>> #ifdef HAVE_LIBDBI
>>     /* handle libdbi datasources */
>> -    if (strncmp("sql",filename,3)==0) {
>> -      if (filename[3]==filename[4]) {
>> +    if (strncmp("sql//",filename,5)==0) {
>>     return
>> rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
>> -      }
>>     }
>> #endif
>> 
>> 
>> 
>> 
>> 
>> peter
>> 
> 
> -- 
> Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
> http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
> 
> _______________________________________________
> rrd-developers mailing list
> rrd-developers at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers



More information about the rrd-developers mailing list