I replaced the subject back to what is should have being all along... David Bustos wrote: > > Oh, so svccfg import always creates SCF_PROPERTY_TM_TYPE, but if the > attribute was missing from the XML element, then it creates it with > a single empty value? Ok, that's a good explanation for why we should > not return SCF_ERROR_TEMPLATE_INVALID when > _read_single_astring_from_pg() returns an empty string. > > I would ask, though, whether it should return TEMPLATE_INVALID if the > property is missing altogether. (Presumably when > _read_single_astring_from_pg() fails with SCF_ERROR_NOT_FOUND.) And > whether it's legitimate for a developer to write a manifest which > specifies the empty string for the attribute. (I presume it's not, and > svccfg import / validate catches that and fails?) The dtd prevents importing a manifest with an empty string as type attribute for a prop_pattern tag. If the type attribute is present, svccfg will make sure it is one of the valid SCF_TYPE_* excluding SCF_TYPE_INVALID, of course.
Basically what we are doing is if a property template exist (it has to otherwise you wouldn't have a valid scf_prop_tmpl_t handle for it) and type is not found, it means that type is wildcarded. It follows the description of most SCF_ERROR_NOT_FOUND in templates: "property doesn't exist or has no value". Antonello