diff options
author | batschul <Frank.Batschulat@Sun.COM> | 2010-07-07 00:31:35 -0700 |
---|---|---|
committer | batschul <Frank.Batschulat@Sun.COM> | 2010-07-07 00:31:35 -0700 |
commit | 2b6c28b8b605a28e1a671f5d6b484cd697e51da6 (patch) | |
tree | 5aee4a82a160b68f6d2560ad2bbf5480c7cc9687 /usr/src/cmd | |
parent | a15847e18d3e20a182ded692244d676004fdc775 (diff) | |
download | illumos-gate-2b6c28b8b605a28e1a671f5d6b484cd697e51da6.tar.gz |
6962440 disable ZFS_PROP_SHARESMB on zoneroot dataset
Diffstat (limited to 'usr/src/cmd')
-rw-r--r-- | usr/src/cmd/zoneadm/zfs.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/usr/src/cmd/zoneadm/zfs.c b/usr/src/cmd/zoneadm/zfs.c index 694f44937e..8966023ebe 100644 --- a/usr/src/cmd/zoneadm/zfs.c +++ b/usr/src/cmd/zoneadm/zfs.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -398,9 +397,16 @@ clone_snap(char *snapshot_name, char *zonepath) (void) printf(gettext("Cloning snapshot %s\n"), snapshot_name); - if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0 || - nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS), - "off") != 0) { + /* + * We turn off zfs SHARENFS and SHARESMB properties on the + * zoneroot dataset in order to prevent the GZ from sharing + * NGZ data by accident. + */ + if ((nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) || + (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS), + "off") != 0) || + (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARESMB), + "off") != 0)) { if (props != NULL) nvlist_free(props); (void) fprintf(stderr, gettext("could not create ZFS clone " @@ -998,9 +1004,16 @@ create_zfs_zonepath(char *zonepath) return; } - if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0 || - nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS), - "off") != 0) { + /* + * We turn off zfs SHARENFS and SHARESMB properties on the + * zoneroot dataset in order to prevent the GZ from sharing + * NGZ data by accident. + */ + if ((nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) || + (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARENFS), + "off") != 0) || + (nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_SHARESMB), + "off") != 0)) { if (props != NULL) nvlist_free(props); (void) fprintf(stderr, gettext("cannot create ZFS dataset %s: " |