OpenSolaris

Printable Version Enter a New Search
Bug ID 6671182
Synopsis libshare_nfs plugin should not fail when nfs config file absent
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_86
Fixed In snv_86
Release Fixed solaris_nevada(snv_86) , solaris_10u6(s10u6_03) (Bug ID:2163727)
Related Bugs 6671097
Submit Date 4-March-2008
Last Update Date 9-May-2008
Description
In initprotofromdefault(), line 2361:

        protoset = sa_create_protocol_properties("nfs");

        if (protoset != NULL) {
                nfs = fopen(NFSADMIN, "r");
                if (nfs != NULL) {
                        while (ret == SA_OK &&
                            fgets(buff, sizeof (buff), nfs) != NULL) {
                                switch (buff[0]) {
                                case '\n':
                                case '#':
                                        /* skip */
                                        break;
                                default:
                                        name = buff;
                                        buff[strlen(buff) - 1] = '\0';
                                        value = strchr(name, '=');
                                        if (value != NULL) { 
                                                *value++ = '\0';
                                                ret = extractprop(name, value);
                                        }
                                }
                        }
                        (void) fclose(nfs);
                } else {
                        (void) printf(gettext("Problem with file: %s\n"),
                            NFSADMIN);
                        ret = SA_SYSTEM_ERR;
                }
        } else {
                ret = SA_NO_MEMORY;
        }
        return (ret);

If the fopen(3C) of the NFS configuration file fails, this function fails.  While that failure makes sense, instead of failing to load the libshare_nfs plugin, the nfs_init() function should load the default values from the proto_options table instead of failing to load the plugin.
Work Around
N/A
Comments
N/A