diff options
author | Alexander Motin <mav@FreeBSD.org> | 2018-02-22 01:42:13 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2018-02-22 01:42:13 +0000 |
commit | 613b0d87da86eb6fd50a95b9b38c5f37efe20f8d (patch) | |
tree | 424cbf487b7c7ce755624a9e163710c66098937f /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | |
parent | 3e6c7d54365e24a67c171f2f7f224efe5003fb32 (diff) | |
parent | dc763b80f4d97cdd878bf19fda4c3197b4b01749 (diff) |
Notes
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 905557376b0f..2f25631c5e22 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -3786,6 +3786,9 @@ zfs_promote(zfs_handle_t *zhp) return (zfs_error(hdl, EZFS_BADTYPE, errbuf)); } + if (!zfs_validate_name(hdl, zhp->zfs_name, zhp->zfs_type, B_TRUE)) + return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf)); + ret = lzc_promote(zhp->zfs_name, snapname, sizeof (snapname)); if (ret != 0) { @@ -4156,6 +4159,10 @@ zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, zhp->zfs_type = ZFS_TYPE_SNAPSHOT; } + /* make sure source name is valid */ + if (!zfs_validate_name(hdl, zhp->zfs_name, zhp->zfs_type, B_TRUE)) + return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf)); + /* * Make sure the target name is valid */ |