Re: rrdcached: path sanitizer
"Kiss Gabor (Bitman)" <[email protected]> Wed, 5 Dec 2012 17:58:23 +0100 (CET)
| Newsgroups | gmane.comp.db.rrdtool.devel |
|---|---|
| Message-ID | <[email protected]> |
> 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(3)
DESCRIPTION
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.
Cheers
Gabor