[rrd-developers] rrdcached: path sanitizer

Kiss Gabor (Bitman) kissg at ssg.ki.iif.hu
Wed Dec 5 17:58:23 CET 2012

> or read the inode and the filesystem associated with the file, that
> should also help to figure out what is the same ...

In theory you are right.
But I'm afraid this is not too efficient.
It requires a lot of searches and/or rewriting database code heavily.

I'd just replace an existing (but ineffective) string manipulation
function with an other one.

> contributions welcome ...

Here you are :-)


       realpath() expands all symbolic links and resolves references  to  /./,
       /../  and  extra  '/' characters in the null-terminated string named by
       path to produce a canonicalized absolute pathname.  The resulting path-
       name is stored as a null-terminated string, up to a maximum of PATH_MAX
       bytes, in the buffer pointed to by resolved_path.  The  resulting  path
       will have no symbolic link, /./ or /../ components.



More information about the rrd-developers mailing list