Skip to content

Fix send:raw permission for send -w -I - #18198

Merged
behlendorf merged 1 commit into
openzfs:masterfrom
msladek:fix-send-raw-delegation
Feb 11, 2026
Merged

behlendorf merged 1 commit into
openzfs:masterfrom
msladek:fix-send-raw-delegation

Conversation

@msladek

@msladek msladek commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Fixes: #18193
Introduced-by: #17543

When performing an incremental raw send with intermediates (-w -I), send:raw introduced in 2.4.0 is not accepted. The code falls back to requiring send and denies the operation when only send:raw is delegated.

Description

This change relaxes the comparison rawok == B_TRUE to a standard truthy check in zfs_secpolicy_send/_new() and updates zfs_send_usertest.ksh to also verify incremental raw send with intermediates behaviour. Also added missing comment markers in the test script.

How Has This Been Tested?

  1. Ran the test case zfs_send_usertest.ksh without the fix to confirm reproduction of the "Permission denied" error.
  2. Applied the fix and confirmed the test passes.
  3. Ran the full test suite.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copilot AI review requested due to automatic review settings February 11, 2026 02:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes delegated permission checks for raw incremental sends with intermediates (zfs send -w -I) so that send:raw is accepted (regression introduced by the send:raw delegation work).

Changes:

  • Adjust zfs_secpolicy_send() / zfs_secpolicy_send_new() to treat rawok as a truthy flag rather than requiring rawok == B_TRUE.
  • Extend zfs_send_usertest.ksh to cover -w -I behavior under send:raw delegation (and fix missing comment markers).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
module/zfs/zfs_ioctl.c Fixes the permission fallback logic so raw-send delegation is honored when rawok isn’t strictly B_TRUE.
tests/zfs-tests/tests/functional/cli_user/zfs_send_delegation_user/zfs_send_usertest.ksh Adds a regression test for incremental raw send with intermediates under delegated permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread module/zfs/zfs_ioctl.c Resolved
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Fixes: openzfs#18193
Introduced-by: openzfs#17543

Signed-off-by: Marc Sladek <marc@sladek.dev>
@msladek
msladek force-pushed the fix-send-raw-delegation branch from 92670bb to b8b2483 Compare February 11, 2026 14:05
@amotin amotin added the Status: Code Review Needed Ready for review and testing label Feb 11, 2026
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 11, 2026
@behlendorf
behlendorf merged commit cc184fe into openzfs:master Feb 11, 2026
38 of 42 checks passed
@msladek
msladek deleted the fix-send-raw-delegation branch February 11, 2026 18:35
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Feb 11, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jul 30, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
pull Bot pushed a commit to A-Archives-and-Forks/openzfs that referenced this pull request Sep 26, 2026
When performing an incremental raw send with intermediates (-w -I),
the standard 'send' permission was incorrectly required instead of
allowing 'send:raw'. This was due to a strict boolean comparison on
the 'rawok' flag in zfs_secpolicy_send() with non-boolean value.

This change normalizes the 'rawok' variable to be strictly 0/1 and
updates the test suite to properly verify delegated raw send behavior.

Introduced-by: openzfs#17543
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Marc Sladek <marc@sladek.dev>
Closes openzfs#18198
Closes openzfs#18193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.4.0 send:raw permission fails on incremental send with intermediates (-I)

4 participants