mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
ZFS allow send:encrypted
A new `zfs allow` permissions that ONLY allows sending replication streams in raw (encrypted) mode, so encrypted data will not be decrypted as part of the replication process. Sponsored-by: Klara, Inc. Sponsored-by: Karakun AG Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Co-authored-by: JT Pennington <jt.pennington@klarasystems.com> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes #17543
This commit is contained in:
committed by
Brian Behlendorf
parent
4a7a04630d
commit
6c4ede4026
+15
-2
@@ -683,6 +683,7 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||
dsl_dataset_t *ds;
|
||||
const char *cp;
|
||||
int error;
|
||||
boolean_t rawok = (zc->zc_flags & 0x8);
|
||||
|
||||
/*
|
||||
* Generate the current snapshot name from the given objsetid, then
|
||||
@@ -705,6 +706,10 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||
|
||||
error = zfs_secpolicy_write_perms_ds(zc->zc_name, ds,
|
||||
ZFS_DELEG_PERM_SEND, cr);
|
||||
if (error != 0 && rawok == B_TRUE) {
|
||||
error = zfs_secpolicy_write_perms_ds(zc->zc_name, ds,
|
||||
ZFS_DELEG_PERM_SEND_RAW, cr);
|
||||
}
|
||||
dsl_dataset_rele(ds, FTAG);
|
||||
dsl_pool_rele(dp, FTAG);
|
||||
|
||||
@@ -714,9 +719,17 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||
static int
|
||||
zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||
{
|
||||
boolean_t rawok = nvlist_exists(innvl, "rawok");
|
||||
int error;
|
||||
|
||||
(void) innvl;
|
||||
return (zfs_secpolicy_write_perms(zc->zc_name,
|
||||
ZFS_DELEG_PERM_SEND, cr));
|
||||
error = zfs_secpolicy_write_perms(zc->zc_name,
|
||||
ZFS_DELEG_PERM_SEND, cr);
|
||||
if (error != 0 && rawok == B_TRUE) {
|
||||
error = zfs_secpolicy_write_perms(zc->zc_name,
|
||||
ZFS_DELEG_PERM_SEND_RAW, cr);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user