Date: Fri, 5 Jun 2015 16:52:24 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284031 - vendor-sys/illumos/dist/uts/common/fs/zfs Message-ID: <201506051652.t55GqOjh013191@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Fri Jun 5 16:52:23 2015 New Revision: 284031 URL: https://svnweb.freebsd.org/changeset/base/284031 Log: 5515 dataset user hold doesn't reject empty tags Author: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com> Approved by: Matthew Ahrens <mahrens@delphix.com> illumos/illumos-gate@752fd8dabccac68d6d09f82f3bf3561e055e400b Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 16:49:21 2015 (r284030) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 16:52:23 2015 (r284031) @@ -5132,6 +5132,19 @@ zfs_ioc_hold(const char *pool, nvlist_t return (SET_ERROR(EINVAL)); } + /* make sure the user didn't pass us any invalid (empty) tags */ + for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; + pair = nvlist_next_nvpair(holds, pair)) { + char *htag; + + error = nvpair_value_string(pair, &htag); + if (error != 0) + return (SET_ERROR(error)); + + if (strlen(htag) == 0) + return (SET_ERROR(EINVAL)); + } + if (nvlist_lookup_int32(args, "cleanup_fd", &cleanup_fd) == 0) { error = zfs_onexit_fd_hold(cleanup_fd, &minor); if (error != 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506051652.t55GqOjh013191>