OpenSolaris

Printable Version Enter a New Search
Bug ID 6630425
Synopsis sa_add_protocol_property() and callers have poor error semantics
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:filesystem
Keywords
Responsible Engineer Doug Mccallum
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_84
Fixed In snv_84
Release Fixed solaris_nevada(snv_84) , solaris_10u6(s10u6_03) (Bug ID:2163718)
Related Bugs
Submit Date 15-November-2007
Last Update Date 9-May-2008
Description
In smb_load_proto_properties(), we have the following bit of code:

		prop = sa_create_property(
                    smb_proto_options[index].name, value != NULL ? value : "");
                if (value != NULL)
                        free(value);
                if (prop != NULL)
                        (void) (protoset, prop);

The problem is that sa_add_protocol_property() can fail, but we're
just casting away the return value here (and everywhere else).  This
should free up 'prop' on failure.

I also don't understand the error propagation in these functions.  The functions
return success/failure, but if either sa_create_property() or
sa_add_protocol_property() fail, we unconditionally return SA_OK.
Work Around
N/A
Comments
N/A