Skip to content

Commit

Permalink
Prevent H5Pset* routines from modifying default plists (HDFGroup#5172)
Browse files Browse the repository at this point in the history
* Prevent H5Pset_vol from changing default VOL
* Prevent public routines from modifying default plists
* Allow default backing FAPL for onion VFD
* Require FAPL in H5Pset_vol()
* Merge into existing H5P tests
  • Loading branch information
mattjala committed Dec 17, 2024
1 parent 622505a commit 26d98d2
Show file tree
Hide file tree
Showing 40 changed files with 351 additions and 233 deletions.
8 changes: 4 additions & 4 deletions src/H5FDcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ H5Pset_core_write_tracking(hid_t plist_id, hbool_t is_enabled, size_t page_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page_size cannot be zero");

/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -568,7 +568,7 @@ H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t *
H5TRACE3("e", "ixx", plist_id, is_enabled, page_size);

/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -607,7 +607,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store)
H5TRACE3("e", "izb", fapl_id, increment, backing_store);

/* Check argument */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Set VFD info values */
Expand Down Expand Up @@ -644,7 +644,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_stor
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, increment, backing_store);

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbu
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "izzz", fapl_id, boundary, block_size, cbuf_size);

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

if (H5FD__direct_populate_config(boundary, block_size, cbuf_size, &fa) < 0)
Expand Down Expand Up @@ -300,7 +300,7 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size /
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "ixxx", fapl_id, boundary, block_size, cbuf_size);

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_DIRECT != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -486,7 +486,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");

/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) {
if (H5FD__direct_populate_config(0, 0, 0, &default_fa) < 0)
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDfamily.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize /*out*/, hid_t *memb_fapl_id /*
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, msize, memb_fapl_id);

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_FAMILY != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -1135,8 +1135,8 @@ H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
FUNC_ENTER_PACKAGE

/* Get the plist structure and family offset */
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADID, FAIL, "can't find object for ID");
if (H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get offset for family driver");

Expand Down
4 changes: 2 additions & 2 deletions src/H5FDhdfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
fprintf(stdout, "called %s.\n", __func__);
#endif

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (FAIL == H5FD__hdfs_validate_config(fa))
Expand Down Expand Up @@ -608,7 +608,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/)

if (fa_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst ptr is NULL");
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");

Expand Down
4 changes: 2 additions & 2 deletions src/H5FDlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
memset(&fa, 0, sizeof(H5FD_log_fapl_t));

/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Duplicate the log file string
Expand Down Expand Up @@ -483,7 +483,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
o_flags |= O_EXCL;

/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
if (NULL == (fa = (const H5FD_log_fapl_t *)H5P_peek_driver_info(plist))) {
/* Use default driver configuration*/
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/)
if (NULL == fa_dst)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true);
if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5P_peek_driver(plist) != H5FD_MIRROR)
Expand Down Expand Up @@ -1308,7 +1308,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa)

LOG_OP_CALL(__func__);

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (NULL == fa)
Expand Down
18 changes: 9 additions & 9 deletions src/H5FDmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
/* Check arguments */
if (fapl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
if (MPI_COMM_NULL == comm)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "MPI_COMM_NULL is not a valid communicator");
Expand Down Expand Up @@ -446,7 +446,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/)
*info = MPI_INFO_NULL;

/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_MPIO != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "VFL driver is not MPI-I/O");
Expand Down Expand Up @@ -506,7 +506,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
if (H5FD_MPIO_INDEPENDENT != xfer_mode && H5FD_MPIO_COLLECTIVE != xfer_mode)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode");
Expand Down Expand Up @@ -542,7 +542,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/)
H5TRACE2("e", "ix", dxpl_id, xfer_mode);

/* Check arguments */
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Get the transfer mode */
Expand Down Expand Up @@ -582,7 +582,7 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Set the transfer mode */
Expand Down Expand Up @@ -621,7 +621,7 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Set the transfer mode */
Expand Down Expand Up @@ -658,7 +658,7 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Set the transfer mode */
Expand Down Expand Up @@ -698,7 +698,7 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Set the transfer mode */
Expand Down Expand Up @@ -831,7 +831,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
FUNC_ENTER_PACKAGE

/* Get a pointer to the fapl */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");

if (H5FD_mpi_self_initialized) {
Expand Down
10 changes: 5 additions & 5 deletions src/H5FDonion.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ H5Pget_fapl_onion(hid_t fapl_id, H5FD_onion_fapl_info_t *fa_out)
if (NULL == fa_out)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info-out pointer");

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID");

if (H5FD_ONION != H5P_peek_driver(plist))
Expand Down Expand Up @@ -325,7 +325,7 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*!", fapl_id, fa);

if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID");
if (NULL == fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info pointer");
Expand All @@ -337,11 +337,11 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info page size");

if (H5P_DEFAULT == fa->backing_fapl_id) {
if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS)))
if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id");
}
else {
if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS)))
if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id");
}

Expand Down Expand Up @@ -1676,7 +1676,7 @@ H5FDonion_get_revision_count(const char *filename, hid_t fapl_id, uint64_t *revi
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "revision count can't be null");

/* Make sure using the correct driver */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid FAPL ID");
if (H5FD_ONION != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Onion VFL driver");
Expand Down
11 changes: 5 additions & 6 deletions src/H5FDros3.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, const H5FD_ros3_fapl_t *fa)
fprintf(stdout, "H5Pset_fapl_ros3() called.\n");
#endif

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

Expand Down Expand Up @@ -460,7 +460,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/)
if (fa_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");

Expand Down Expand Up @@ -611,7 +611,7 @@ H5Pget_fapl_ros3_token(hid_t fapl_id, size_t size, char *token_dst /*out*/)
if (token_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "token_dst is NULL");

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -794,7 +794,7 @@ H5Pset_fapl_ros3_token(hid_t fapl_id, const char *token)

if (fapl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -937,15 +937,14 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
if (flags != H5F_ACC_RDONLY)
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed");

if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list");

if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)");

/* Session/security token */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a file access property list");
if ((token_exists = H5P_exist_plist(plist, ROS3_TOKEN_PROP_NAME)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "failed to check if property token exists in plist");
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsec2.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ H5Pset_fapl_sec2(hid_t fapl_id)
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", fapl_id);

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

ret_value = H5P_set_driver(plist, H5FD_SEC2, NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsplitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/)
config->wo_fapl_id = H5I_INVALID_HID;

/* Check and get the splitter fapl */
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDsubfiling/H5FDioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ H5Pset_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *vfd_config)

H5FD_IOC_LOG_CALL(__func__);

if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

if (vfd_config == NULL) {
Expand Down Expand Up @@ -382,7 +382,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out)
if (config_out == NULL)
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out is NULL");

if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

if (H5FD_IOC != H5P_peek_driver(plist_ptr))
Expand Down Expand Up @@ -1452,7 +1452,7 @@ H5FD__ioc_del(const char *name, hid_t fapl)
* out of sync
*/

if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true)))
H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
assert(H5FD_IOC == H5P_peek_driver(plist));

Expand Down
Loading

0 comments on commit 26d98d2

Please sign in to comment.