diff options
author | John Sonnenschein <johns@joyent.com> | 2012-05-17 18:26:57 +0000 |
---|---|---|
committer | John Sonnenschein <johns@joyent.com> | 2012-05-17 18:26:57 +0000 |
commit | 04b244dd661c24b510ac22936decfc0972d202d3 (patch) | |
tree | 3ebfef98afc303fddf3415d6fba64e8682f495e8 /usr/src/cmd/fs.d/nfs | |
parent | eac250589e41f1b705e1b7427b02b3379aac9f9e (diff) | |
parent | a69187741b83640a90dd8586195456dd50c016a8 (diff) | |
download | illumos-joyent-20120517.tar.gz |
Merge git.joyent.com:illumos-joyent20120517
Diffstat (limited to 'usr/src/cmd/fs.d/nfs')
-rw-r--r-- | usr/src/cmd/fs.d/nfs/lib/smfcfg.c | 20 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/lib/smfcfg.h | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/usr/src/cmd/fs.d/nfs/lib/smfcfg.c b/usr/src/cmd/fs.d/nfs/lib/smfcfg.c index 78b34389a5..ced841d945 100644 --- a/usr/src/cmd/fs.d/nfs/lib/smfcfg.c +++ b/usr/src/cmd/fs.d/nfs/lib/smfcfg.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include <stdio.h> #include <stdlib.h> @@ -342,8 +343,23 @@ fs_smf_get_prop(smf_fstype_t fstype, char *prop_name, char *cbuf, } else { ret = scf_error(); } - if ((ret != 0) && scf_error() != SCF_ERROR_NONE) - fprintf(stdout, gettext("%s\n"), scf_strerror(ret)); + if ((ret != 0) && scf_error() != SCF_ERROR_NONE) { + /* + * This is a workaround for the NFS service manifests not + * containing the proper properties in local zones. + * + * When in a local zone and the property doesn't exist on an NFS + * service (most likely nfs/server or nfs/client), don't print + * the error. The caller will still see the correct error code, + * but a user creating a delegated dataset or mounting an NFS + * share won't see this spurious error. + */ + if (getzoneid() == GLOBAL_ZONEID || + scf_error() != SCF_ERROR_NOT_FOUND) { + fprintf(stdout, gettext("%s\n"), scf_strerror(ret)); + } + } + out: fs_smf_fini(phandle); return (ret); diff --git a/usr/src/cmd/fs.d/nfs/lib/smfcfg.h b/usr/src/cmd/fs.d/nfs/lib/smfcfg.h index 46855ab8ed..7eae380827 100644 --- a/usr/src/cmd/fs.d/nfs/lib/smfcfg.h +++ b/usr/src/cmd/fs.d/nfs/lib/smfcfg.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SMFCFG_H @@ -42,6 +43,7 @@ #include <locale.h> #include <errno.h> #include <sys/types.h> +#include <zone.h> #ifdef __cplusplus extern "C" { |