char * vortex_support_find_data_file ( VortexCtx ctx,
const char *  name 
)

Allows to lookup for a file into the known vortex data file locations.

While locating data files inside Vortex Library context a set of function are used to allows Vortex Library API consumers to produce easily application level code that is platform/directory-structure independent as possible.

Because profile definitions needs DTD files, certificates, xml documents, etc, a common problem to face is how to locate this files not only into the development environment but also into the production one.

Vortex Library allows to configure known file locations using vortex_support_add_search_path and vortex_support_add_search_path_ref.

Once configured search paths, application level calls to this function to locate files using basenames such as myCertificate.cert, channel.dtd, etc. This avoid full paths file names that are a problem while moving around the source code not only across different platforms but also on the same.

See vortex_support_add_search_path for more information about known data files location.

This function could have a problem while looking for sensitive files. If a path is not properly configured, an attacker is able to place a manipulated copy for the file inside a valid path, but not the one expected. In such case you must perform domain constrained searches using vortex_support_domain_find_data_file and its associated function to install search path with a domain constraing them:

Parameters
ctxThe context where the operation will be performed.
namethe base file name to lookup.
Returns
NULL or the file path. Value returned should be unrefered using axl_free when no longer needed.

References vortex_support_domain_find_data_file().

Referenced by vortex_listener_parse_conf_and_start().