David Bustos wrote:
> Quoth Liane Praza on Tue, Oct 14, 2008 at 09:58:26PM -0700:
>> David Bustos wrote:
>>> Quoth Liane Praza on Thu, Oct 09, 2008 at 08:49:01PM -0700:
>>>>>>>> http://cr.opensolaris.org/~lianep/webrev-20080822/
>>>>>>> lib/libscf/common/scf_tmpl.c
> ...
>>>>>>> 4162,68,72: Is there a reason to return SCF_ERROR_CONSTRAINT_VIOLATED
>>>>>>>  instead of SCF_ERROR_TEMPLATE_INVALID?
> ...
>>> Ah, yes, the developer could be calling a count function on an int
>>> property.  If min > max, though, doesn't that necessarily mean the
>>> template is invalid?   I.e., that the developer delivering the manifest
>>> made an error, rather than the developer calling the function?  And for
>>> the int functions, if the value doesn't fit in an int64_t, doesn't that
>>> also mean that the developer delivering the manifest made an error,
>>> rather than the developer calling the function?
>> But in the count representation, -1 > 1, which isn't true in the int 
>> representation.  Template isn't invalid.
> 
> I presume you mean the case where the string contains "-1,1".  Won't
> strtoull() fail on the '-' before we reach the min > max comparison?

It doesn't fail in the test I just wrote.

> And what about the int out-of-range cases?

The checks for errno are correct, as the number may be too large to 
represent in an int, but not a count.

I could change the check for min > max in the int function, but it'll 
probably invalidate some of our tests.  Think it's important enough to 
make changes both in the tests and the code?  If so, I can.

>>>>>>> cmd/svc/milestone/restarter.xml
>>>>>>> 80: Isn't restarter created by librestart?
[...]
> Ok.  Please add a comment.

Done.

liane

Reply via email to