[PR #5943/53f72973 backport][stable-6] zfs_delegate_admin: fix: zfs allow cannot parse unknown uid/gid #6086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #5943 as merged into main (53f7297).
When setting allow permissions for particular users or groups there will be circumstances when that user is not known to the host system.
In that case the output of
zfs allow <pool/dataset>
looks similar to this:$ sudo zfs allow tank/test
---- Permissions on tank/test ---------------------------------------
Local+Descendent permissions:
user (unknown: 1002) hold
user zfsuser receive
The fix in this commit removes
(unknown:
+)
from the output leaving only the uid/gid.This allows the current parser to continue even if the uid/gid is not known.
This situation occurs most often when moving a zpool from one system to another that may not have the same users/groups. Simply adding permissions to a user/group and then deleting the user/group from the system will cause this situation to occur.
SUMMARY
Fixes #5941
Removing
(unknown:
+)
fromline
allows the user to remove and permissions to uids or gids even if the host system is unaware of an actual user/group by that name.Ideally, openzfs could modify the
zfs allow
command to allow for machine readable output like most of the zfs commands available: e.g.-H -o name,permissions,entity
.ISSUE TYPE
COMPONENT NAME
community.general.zfs_delegate_admin
ADDITIONAL INFORMATION
Testing