]> granicus.if.org Git - zfs/commitdiff
OpenZFS 7071 - lzc_snapshot does not fill in errlist on ENOENT
authorGeorge Melikov <mail@gmelikov.ru>
Tue, 17 Jan 2017 22:52:17 +0000 (01:52 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Jan 2017 22:52:17 +0000 (14:52 -0800)
Authored by: Igor Kozhukhov ikozhukhov@gmail.com
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
OpenZFS-issue: https://www.illumos.org/issues/7071
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/25f7d99
Closes #5597

module/zfs/zfs_ioctl.c

index 439134decd70df5ca00964af6c4f7aa68116d84e..ba4e0ee3fcada38541fb5ad1a3e11066337a4c4e 100644 (file)
@@ -467,6 +467,14 @@ zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr)
        dsl_dataset_t *ds;
        dsl_pool_t *dp;
 
+       /*
+        * First do a quick check for root in the global zone, which
+        * is allowed to do all write_perms.  This ensures that zfs_ioc_*
+        * will get to handle nonexistent datasets.
+        */
+       if (INGLOBALZONE(curproc) && secpolicy_zfs(cr) == 0)
+               return (0);
+
        error = dsl_pool_hold(name, FTAG, &dp);
        if (error != 0)
                return (error);