diff -r 9116acef0349 -r fcc1e406c13f usr/src/cmd/fs.d/nfs/mountd/mountd.c --- a/usr/src/cmd/fs.d/nfs/mountd/mountd.c Wed Aug 11 14:15:47 2010 -0700 +++ b/usr/src/cmd/fs.d/nfs/mountd/mountd.c Wed Aug 11 17:11:30 2010 -0500 @@ -76,8 +76,11 @@ #include #include #include +#include +#include #include #include +#include "smfcfg.h" extern int daemonize_init(void); extern void daemonize_fini(int fd); @@ -361,6 +364,8 @@ bool_t exclbind = TRUE; bool_t can_do_mlp; long thr_flags = (THR_NEW_LWP|THR_DAEMON); + char defval[4]; + int defvers, ret, bufsz; int pipe_fd = -1; @@ -412,33 +417,32 @@ /* * Read in the NFS version values from config file. */ - if ((defopen(NFSADMIN)) == 0) { - char *defval; - int defvers; + bufsz = 4; + ret = nfs_smf_get_prop("server_versmin", defval, DEFAULT_INSTANCE, + SCF_TYPE_INTEGER, NFSD, &bufsz); + if (ret == SA_OK) { + errno = 0; + defvers = strtol(defval, (char **)NULL, 10); + if (errno == 0) { + mount_vers_min = defvers; + /* + * special because NFSv2 is + * supported by mount v1 & v2 + */ + if (defvers == NFS_VERSION) + mount_vers_min = MOUNTVERS; + } + } - if ((defval = defread("NFS_SERVER_VERSMIN=")) != NULL) { - errno = 0; - defvers = strtol(defval, (char **)NULL, 10); - if (errno == 0) { - mount_vers_min = defvers; - /* - * special because NFSv2 is - * supported by mount v1 & v2 - */ - if (defvers == NFS_VERSION) - mount_vers_min = MOUNTVERS; - } + bufsz = 4; + ret = nfs_smf_get_prop("server_versmax", defval, DEFAULT_INSTANCE, + SCF_TYPE_INTEGER, NFSD, &bufsz); + if (ret == SA_OK) { + errno = 0; + defvers = strtol(defval, (char **)NULL, 10); + if (errno == 0) { + mount_vers_max = defvers; } - if ((defval = defread("NFS_SERVER_VERSMAX=")) != NULL) { - errno = 0; - defvers = strtol(defval, (char **)NULL, 10); - if (errno == 0) { - mount_vers_max = defvers; - } - } - - /* close defaults file */ - defopen(NULL); } /* @@ -447,7 +451,7 @@ * to start nfsauth service, so continue on regardless of values. */ if (mount_vers_min > mount_vers_max) { - fprintf(stderr, "NFS_SERVER_VERSMIN > NFS_SERVER_VERSMAX"); + fprintf(stderr, "server_versmin > server_versmax"); mount_vers_max = mount_vers_min; } (void) setlocale(LC_ALL, "");