David Bustos writes: > Quoth Antonello Cruz on Fri, Oct 10, 2008 at 02:41:14PM -0700: > > >>>>>> lib/libscf/common/scf_tmpl.c > > >>>>>> 3479: Why isn't this SCF_ERROR_TEMPLATE_INVALID? > ... > > > Ok, sorry, I asked the wrong question. I should have asked "Is there > > > a way to create a property template through the manifest which has an > > > SCF_PROPERTY_TM_TYPE with a single empty value?" And then I think the > > > same decision process applies as for line 3972 above. > > > > David, you get an SCF_PROPERTY_TM_TYPE if the manifest has > > <prop_pattern> with no type attribute. > > Really? I would think that svccfg import would only create an > SCF_PROPERTY_TM_TYPE property if prop_pattern *had* a type attribute. > Otherwise, where do you put the value of the type attribute when it's > present?
Unlike other properties, svccfg does create a property with an empty string for SCF_PROPERTY_TM_TYPE even if the manifest does not declare the prop_pattern type. I can no longer remember why I coded SCF_PROPERTY_TM_TYPE this way. It is a trivial code change to make SCF_PROPERTY_TM_TYPE act like all the other optional properties. > > > The second case of SCF_ERROR_NOT_FOUND would occur only if the type was > > manually deleted, which may not constitute an invalid template. If a > > property template exists and it has no type or type is an empty string, > > it means that property is wildcarded and can be of any type. > > Yes, I understand that you're interpreting an empty string the same way > as the absence of the property. I'm questioning whether that's a good > idea or not. I think the first piece of evidence we need is whether the > official interfaces (svccfg import) ever create the property with an > empty string. If they don't, as I suspect, then we have to decide > whether we want to be strict, or future-proof. It seems you have chosen > the latter, which is ok, but not what I would have chosen, I don't > think. > > > David > _______________________________________________ > smf-discuss mailing list > smf-discuss at opensolaris.org