summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libzfs/common
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2017-10-13 09:06:57 +0000
committeravg <avg@FreeBSD.org>2017-10-13 09:06:57 +0000
commit52064f8cbf1233e6c15c20952cdffba216547da4 (patch)
treeabd12c5d893a0228e0c31a4cc8902d526cd2aec2 /cddl/contrib/opensolaris/lib/libzfs/common
parent275fe4491663fe1a47411b36360926ecfbf7b9de (diff)
downloadFreeBSD-src-52064f8cbf1233e6c15c20952cdffba216547da4.zip
FreeBSD-src-52064f8cbf1233e6c15c20952cdffba216547da4.tar.gz
MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
index a9d3bef..2bf494f 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
+++ b/cddl/contrib/opensolaris/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 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
+ * Copyright 2017 RackTop Systems.
*/
/*
@@ -88,7 +89,7 @@ zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **,
zfs_share_proto_t);
/*
- * The share protocols table must be in the same order as the zfs_share_prot_t
+ * The share protocols table must be in the same order as the zfs_share_proto_t
* enum in libzfs_impl.h
*/
typedef struct {
@@ -873,7 +874,7 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
/* make sure libshare initialized */
if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
free(mntpt); /* don't need the copy anymore */
- return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+ return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
@@ -884,12 +885,13 @@ unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
if (share != NULL) {
err = zfs_sa_disable_share(share, proto_table[proto].p_name);
if (err != SA_OK) {
- return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+ return (zfs_error_fmt(hdl,
+ proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
name, _sa_errorstr(err)));
}
} else {
- return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
+ return (zfs_error_fmt(hdl, proto_table[proto].p_unshare_err,
dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"),
name));
}
OpenPOWER on IntegriCloud