[PATCH] numericoid OIDs validation
Kamen Mazdrashki
kamenim at samba.org
Wed Oct 20 05:13:07 MDT 2010
Hi Tridge,
I am currently working on a prefixMap corruption in S4.
I am going to change OIDs validation function in dsdb/schema_syntax.c
so that numericoid OIDs are validated in a different way than using
prefixMap/Schema to validate those.
I want to use ber_write_*/ber_read_* functions to do the validation
and while implementing this I've noticed that ber_write_OID_String()
function is not tested for error cases. So I did :).
Please check at:
http://git.samba.org/?p=kamenim/samba.git;a=shortlog;h=refs/heads/pfm-save-review
But what I am wondering now is, should I push this patch at all.
It will make ber_write_OID_String() a little bit slower with the added value
of being more robust against invalid OIDs.
Perhaps it is good thing for the function, but I am afraid it is very often
used with OIDs that are for sure a valid OIDs.
(2) Another way is to implement just OID_validation() function
that is to be used when validating numeric OIDs (usually when we add new
objects in Schema).
(3) And yet another way I could think of is let syntax->validate() functions
to validate those and just make sure they do really validate correctly by
implementing unit-test for dsdb_syntax syntaxes.
(validate() functions usually do write/read/compare, so they should
fail on invalid OIDs even when ber_write_OID_() doesn't fail)
Sorry, it became a rather long mail for a small thing but... nevertheless,
what you thing about above mentioned approaches?
--
CU,
Kamen Mazdrashki
More information about the samba-technical
mailing list