diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-12-27 22:00:32 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-12-27 22:00:32 (GMT) |
commit | 9cc406633c29d4167031dc85b950858f90163cbc (patch) | |
tree | ad11ed7fb31e7078af6d180ae3e7207569ad8070 /src/H5PLint.c | |
parent | 1cc890e333a2563195eeea6154fd921221c3c439 (diff) | |
download | hdf5-9cc406633c29d4167031dc85b950858f90163cbc.zip hdf5-9cc406633c29d4167031dc85b950858f90163cbc.tar.gz hdf5-9cc406633c29d4167031dc85b950858f90163cbc.tar.bz2 |
Fixed plugin loading so it actually checks the plugin type.
Diffstat (limited to 'src/H5PLint.c')
-rw-r--r-- | src/H5PLint.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/H5PLint.c b/src/H5PLint.c index ded315a..8dec14b 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -311,6 +311,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *success, const void **plugin_info) { H5PL_HANDLE handle = NULL; + H5PL_get_plugin_type_t get_plugin_type = NULL; H5PL_get_plugin_info_t get_plugin_info = NULL; herr_t ret_value = SUCCEED; @@ -333,12 +334,22 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, HGOTO_DONE(SUCCEED) } + /* Return a handle for the function H5PLget_plugin_type in the dynamic library. + * The plugin library is supposed to define this function. + */ + if (NULL == (get_plugin_type = (H5PL_get_plugin_type_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_type"))) + HGOTO_DONE(SUCCEED) + /* Return a handle for the function H5PLget_plugin_info in the dynamic library. - * The plugin library is suppose to define this function. + * The plugin library is supposed to define this function. */ if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) HGOTO_DONE(SUCCEED) + /* Check the plugin type and return if it doesn't match the one passed in */ + if(type != (H5PL_type_t)(*get_plugin_type)()) + HGOTO_DONE(SUCCEED) + /* Get the plugin information */ switch (type) { case H5PL_TYPE_FILTER: @@ -364,7 +375,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, /* Get the plugin info */ if(NULL == (cls = (const H5VL_class_t *)(*get_plugin_info)())) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL driver info from plugin") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL connector info from plugin") /* Which kind of key are we looking for? */ if(key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { |