libzfs: report invalid permission name in zfs allow

zfs allow with a typo (e.g. "snapshop") produced the misleading
error "operation not applicable to datasets of this type".  Report
"invalid permission" instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Christos Longros <chris.longros@gmail.com>
Closes #18401
Closes #11903
This commit is contained in:
Christos Longros
2026-04-20 19:15:29 +02:00
committed by GitHub
parent 4339b4eb2f
commit 1cebe8a38e
+1 -1
View File
@@ -5138,7 +5138,7 @@ zfs_set_fsacl(zfs_handle_t *zhp, boolean_t un, nvlist_t *nvl)
err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
break;
case EINVAL:
err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
err = zfs_error(hdl, EZFS_BADPERM, errbuf);
break;
case ENOENT:
err = zfs_error(hdl, EZFS_NOENT, errbuf);