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

Tobias Oetiker tobi at oetiker.ch
Thu Mar 3 07:56:06 CET 2011


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



More information about the rrd-developers mailing list