bind9/lib/ns/tests
Michał Kępień d181c28c60 Add ns_plugin_expandpath()
Implement a helper function which, given an input string:

  - copies it verbatim if it contains at least one path separator,
  - prepends the named plugin installation directory to it otherwise.

This function will allow configuration parsing code to conveniently
determine the full path to a plugin module given either a path or a
filename.

While other, simpler ways exist for making sure filenames passed to
dlopen() cause the latter to look for shared objects in a specific
directory, they are very platform-specific.  Using full paths is thus
likely the most portable and reliable solution.

Also added unit tests for ns_plugin_expandpath() to ensure it behaves
as expected for absolute paths, relative paths, and filenames, for
various target buffer sizes.

(Note: plugins share a directory with named on Windows; there is no
default plugin path. Therefore the source path is copied to the
destination path with no modification.)
2019-03-05 16:06:24 -08:00
..
testdata Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Kyuafile Add ns_plugin_expandpath() 2019-03-05 16:06:24 -08:00
listenlist_test.c set up hooks.c to enable setting hook points and loading modules 2018-12-06 10:29:05 -08:00
Makefile.in Add ns_plugin_expandpath() 2019-03-05 16:06:24 -08:00
notify_test.c set up hooks.c to enable setting hook points and loading modules 2018-12-06 10:29:05 -08:00
nstest.c make hook actions return an enum instead of a bool 2018-12-06 10:36:50 -08:00
nstest.h make hook actions return an enum instead of a bool 2018-12-06 10:36:50 -08:00
plugin_test.c Add ns_plugin_expandpath() 2019-03-05 16:06:24 -08:00
query_test.c copy ns_hook objects before adding them to a hook table 2018-12-06 10:29:12 -08:00