]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix `zpool create -o <property>` error message
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 13 Nov 2019 17:23:14 +0000 (09:23 -0800)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2019 17:23:14 +0000 (09:23 -0800)
When `zpool create -o <property>` is run without root permissions
and the pool property requested is not specifically enumerated in
zpool_valid_proplist().  Then an incorrect error message referring
to an invalid property is printed rather than the expected permission
denied error.

Specifying a pool property at create time should be handled the same
way as filesystem properties in zfs_valid_proplist().  There should
not be default zfs_error_aux() set for properties which are not
listed.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9550
Closes #9568

lib/libzfs/libzfs_pool.c

index 1a97c16660e13b55126724e241ade43325c35574..7f3ec5d0d4fa0d67c95bef0434a230bf075310f5 100644 (file)
@@ -724,8 +724,6 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
                        break;
 
                default:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "property '%s'(%d) not defined"), propname, prop);
                        break;
                }
        }