Add --no-preserve-encryption flag

* Add an option to send datasets with params or replicate
without preserving encryption
* Add a test case for the new functionality

Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Chris Jacobs <idefix2020dev@gmail.com>
Closes #18240
This commit is contained in:
Idefix2020
2026-03-06 00:08:17 +01:00
committed by GitHub
parent c329530e6b
commit 5dad9459d5
5 changed files with 62 additions and 22 deletions
@@ -41,6 +41,7 @@
# encryption child
# 10. Verify that an unencrypted recursive send can be received as an
# encryption child
# 11. Verify an encrypted pool can be sent with props only when -U is set
#
verify_runnable "both"
@@ -119,6 +120,13 @@ log_mustnot eval "zfs send -i $esnap $esnap2 |" \
"zfs recv -o pbkdf2iters=100k $TESTPOOL/recv"
log_must zfs destroy -r $TESTPOOL/recv
# The user has to explicitly allow sending a dataset unecrypted when sending
# an encrypted dataset with properties
log_note "Must not be able to send an encrypted dataset with props unless the -U flag is set"
log_mustnot eval "zfs send -p $esnap | zfs recv $TESTPOOL/recv"
log_must eval "zfs send -p -U $esnap | zfs recv $TESTPOOL/recv"
log_must zfs destroy -r $TESTPOOL/recv
# Test that we can receive a simple stream as an encryption root.
log_note "Must be able to receive stream as encryption root"
ds=$TESTPOOL/recv