-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent H5Pset* routines from modifying default plists #5172
Conversation
8bd42de
to
2d5b05f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principal, yes, but rejecting the default property list of each type should apply to all the 'set' routines, for all types of property lists.
And, you don't need to reject H5P_DEFAULT, since H5P_object_verify() will already fail for that value.
I suggest that you put the appropriate checking inside H5P_object_verify() |
In this case I'd call it a "not letting perfect be the enemy of good enough" situation. I asked Matt to create this PR due to the issue I encountered specifically with changing the VOL on the default FAPL. Fixing all the cases (and testing them) would be a decently larger effort.
I'd actually prefer to explicitly reject |
I understand your perspective, but I think the problem should be easy to address in a few hours of work: add a new 'is_lib_default' flag to the property list structure, which is only set to true for the actual default property lists, and is set to false when one of those property lists is copied. Then add a parameter to H5P_object_verify(), or someplace else that's central to the 'set' calls, that indicates that H5P_object_verify() is being called from a 'set' routine. Then fail in H5P_object_verify() when both are true. Probably only ~50 lines of actual code. (and 600 lines of trivial changes to calls to H5P_object_verify :-) |
cdea6c2
to
0261418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge the new and old tests together, so there's only one property list test.
Otherwise, looks good - thanks for taking the time to implement a holistic approach that addresses the problem at its root.
f9c2b8d
to
8c7dff4
Compare
* 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
* 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
This prevents the connector in
H5VL_def_conn_s
and the one used byH5P_DEFAULT/H5P_FILE_ACCESS_DEFAULT
from diverging.