Bug #3816
closed"zfs allow" mis-displays filesystems with "allow -c" but not "allow -s" set
100%
Description
If you add a "create-time permission" with "zfs allow -c" to a filesystem that doesn't have any permission-sets defined, zfs allow mis-displays the permissions - it labels the "Create-time permissions" as "Permission sets".
If you add a permission set definition, the right thing happens:
to reproduce:
zfs create tank/test
zfs allow -c send tank/test
zfs allow tank/test
[this is where you get erroneous output]
zfs allow -s @foo receive tank/test
zfs allow tank/test
[this is where you get correct output]
Bug appears to be in usr/src/cmd/zfs/zfs_main.c : print_set_creat_perms(). Looks like it should be using the return value of who_type2weight() to index into sc_title[] rather than assuming there will always be a permission set present if there are create-time permissions.
Files
Related issues
Updated by Marcel Telka over 9 years ago
- Category set to zfs - Zettabyte File System
Updated by Bill Sommerfeld over 9 years ago
FYI I've got a patch for this that I need to clean up and share.
Updated by Bill Sommerfeld over 9 years ago
- File 3816.patch 3816.patch added
I've attached what I have now; probably could be improved.
Updated by Bill Sommerfeld 4 months ago
This was fixed in openzfs in
https://github.com/openzfs/zfs/commit/0238a9755b07d1a2705e970f5c09fb7fa261ea5d
Updated by Bill Sommerfeld 4 months ago
- Status changed from New to In Progress
- Assignee set to Bill Sommerfeld
- Difficulty changed from Medium to Bite-size
- Tags deleted (
needs-triage) - External Bug set to openzfs:7519
OpenZFS patch applied manually to zfs_main.c and runfiles/common.run; the manpage formatting change doesn't seem relevant to our current manpage. Running a zfstest baseline run right now prior to trying it with the fix.
Updated by Bill Sommerfeld 4 months ago
Digging further into the openzfs test change in their patch, it appears to be unrelated to the code change; the test fails for an unrelated reason (see #15389) so I'll be splitting it out into a separate change. There does not appear to be any test which asserts that the section headers are correct in zfs allow
output.
Updated by Bill Sommerfeld 4 months ago
Extending the delegation test to check that the right headers are present in zfs allow
output was straightforward. I added a verify_allow_output
function in delegate_common.kshlib
and used it in two test cases which made simple use of zfs allow -c
and zfs allow -s
.
With the modified tests, I see an (expected) failure with the stock /sbin/zfs
; the test passes when run with a /sbin/zfs
with the fix.
Updated by Bill Sommerfeld 3 months ago
Testing of an onu'ed nightly ran cleanly:
testrunner@openindiana:~$ /opt/zfs-tests/bin/zfstest -T delegate Test: /opt/zfs-tests/tests/functional/delegate/setup (run as root) [00:12] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_001_pos (run as root) [00:17] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_002_pos (run as root) [00:07] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_003_pos (run as root) [00:15] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_004_pos (run as root) [00:09] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_005_pos (run as root) [00:10] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_006_pos (run as root) [00:08] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_007_pos (run as root) [00:08] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_008_pos (run as root) [00:02] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_009_neg (run as root) [00:00] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_010_pos (run as root) [00:39] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_011_neg (run as root) [00:00] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_allow_012_neg (run as root) [00:32] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_001_pos (run as root) [00:04] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_002_pos (run as root) [00:04] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_003_pos (run as root) [00:04] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_004_pos (run as root) [00:01] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_005_pos (run as root) [00:01] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_006_pos (run as root) [00:03] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_007_neg (run as root) [00:02] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/zfs_unallow_008_neg (run as root) [00:03] [PASS] Test: /opt/zfs-tests/tests/functional/delegate/cleanup (run as root) [00:08] [PASS] Results Summary PASS 22 Running Time: 00:03:20 Percent passed: 100.0% Log directory: /var/tmp/test_results/20230302T114505 testrunner@openindiana:~$ uname -a SunOS openindiana 5.11 bug3816-0-g5e41745f45 i86pc i386 i86pc testrunner@openindiana:~$
Updated by Electric Monk 3 months ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 5146325846cd457c912118089437f46b9e7475f6
commit 5146325846cd457c912118089437f46b9e7475f6 Author: Bill Sommerfeld <sommerfeld@alum.mit.edu> Date: 2023-03-03T17:45:54.000Z 3816 "zfs allow" mis-displays filesystems with "allow -c" but not "allow -s" set Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Rich Lowe <richlowe@richlowe.net> Approved by: Gordon Ross <gordon.w.ross@gmail.com>