summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/lib/libzfs/common/libzfs_mount.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_mount.c b/usr/src/lib/libzfs/common/libzfs_mount.c
index ae6df7fa16..2c082989be 100644
--- a/usr/src/lib/libzfs/common/libzfs_mount.c
+++ b/usr/src/lib/libzfs/common/libzfs_mount.c
@@ -24,6 +24,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
+ * Copyright 2017 Joyent, Inc.
*/
/*
@@ -662,8 +663,14 @@ _zfs_init_libshare(void)
static int
zfs_init_libshare_impl(libzfs_handle_t *zhandle, int service, void *arg)
{
+ /*
+ * libshare is either not installed or we're in a branded zone. The
+ * rest of the wrapper functions around the libshare calls already
+ * handle NULL function pointers, but we don't want the callers of
+ * zfs_init_libshare() to fail prematurely if libshare is not available.
+ */
if (_sa_init == NULL)
- return (SA_CONFIG_ERR);
+ return (SA_OK);
/*
* Attempt to refresh libshare. This is necessary if there was a cache