From 3b61b335c37f67a23674820a1cf865f4e058d617 Mon Sep 17 00:00:00 2001 From: dougm Date: Mon, 24 Mar 2008 14:30:03 -0700 Subject: 6678356 zfs set sharenfs=anon=0 complains invalid option --- usr/src/lib/libshare/common/libshare.c | 5 ++--- usr/src/lib/libshare/nfs/libshare_nfs.c | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'usr/src/lib/libshare') diff --git a/usr/src/lib/libshare/common/libshare.c b/usr/src/lib/libshare/common/libshare.c index e7583a0585..e5c5578c46 100644 --- a/usr/src/lib/libshare/common/libshare.c +++ b/usr/src/lib/libshare/common/libshare.c @@ -3200,12 +3200,11 @@ sa_add_property(void *object, sa_property_t property) sa_group_t parent; sa_group_t group; char *proto; - sa_handle_t handle; if (property != NULL) { + sa_handle_t handle; handle = sa_find_group_handle((sa_group_t)object); - if (handle == NULL) - return (SA_CONFIG_ERR); + /* It is legitimate to not find a handle */ proto = sa_get_optionset_attr(object, "type"); if ((ret = sa_valid_property(handle, object, proto, property)) == SA_OK) { diff --git a/usr/src/lib/libshare/nfs/libshare_nfs.c b/usr/src/lib/libshare/nfs/libshare_nfs.c index 8ddc74e1a0..7d4ef12210 100644 --- a/usr/src/lib/libshare/nfs/libshare_nfs.c +++ b/usr/src/lib/libshare/nfs/libshare_nfs.c @@ -1603,8 +1603,13 @@ public_exists(sa_handle_t handle, sa_share_t skipshare) { sa_group_t group = NULL; + /* + * If we don't have a handle, we can only do syntax check. We + * can't check against other shares so we assume OK and will + * catch the problem only when we actually try to apply it. + */ if (handle == NULL) - return (SA_SYSTEM_ERR); + return (SA_OK); if (skipshare != NULL) { group = sa_get_parent_group(skipshare); -- cgit v1.2.3