[ovs-dev] [PATCH v11 2/8] util: Add a path canonicalizer

Ben Pfaff blp at ovn.org
Tue Apr 12 00:03:24 UTC 2016


(Yow, that's a lot of CCs.)

On Fri, Apr 01, 2016 at 11:31:31AM -0400, Aaron Conole wrote:
> This commit adds a new function (ovs_realpath) to perform the role of
> realpath on various operating systems. The purpose is to ensure that a
> given path to file exists, and to return a completely resolved path (sans
> '.' and '..').
> 
> Signed-off-by: Aaron Conole <aconole at redhat.com>

Path canonicalization is a pretty big hammer.  In other cases where OVS
relies on an absolute path, it uses textual comparison on a prefix of
the name (representing a directory) and rejects use of ".." following
the prefix.  This is pretty easy to get right, and it is not as
heavyweight, and it does not have to actually do file system operations
(stat, readlink, ...), and its verdict can't change as a result of
changes to the file system (e.g. new or modified or deleted symlinks,
NFS servers that are down), and so on.

Do you think we really need path canonicalization?

Thanks,

Ben.



More information about the dev mailing list