Merge 9038ce4936
into b3b7491615
This commit is contained in:
commit
11ac1af1e3
|
@ -5284,6 +5284,7 @@ zfs_do_receive(int argc, char **argv)
|
||||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||||
#define ZFS_DELEG_PERM_SHARE "share"
|
#define ZFS_DELEG_PERM_SHARE "share"
|
||||||
#define ZFS_DELEG_PERM_SEND "send"
|
#define ZFS_DELEG_PERM_SEND "send"
|
||||||
|
#define ZFS_DELEG_PERM_SEND_RAW "send-raw"
|
||||||
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
||||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||||
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
||||||
|
@ -5325,6 +5326,7 @@ static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
|
||||||
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
{ ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
|
||||||
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
{ ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
|
||||||
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
{ ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
|
||||||
|
{ ZFS_DELEG_PERM_SEND_RAW, ZFS_DELEG_NOTE_SEND_RAW },
|
||||||
{ ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
|
{ ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
|
||||||
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
{ ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
|
||||||
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
{ ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
|
||||||
|
@ -5909,6 +5911,12 @@ deleg_perm_comment(zfs_deleg_note_t note)
|
||||||
case ZFS_DELEG_NOTE_SEND:
|
case ZFS_DELEG_NOTE_SEND:
|
||||||
str = gettext("");
|
str = gettext("");
|
||||||
break;
|
break;
|
||||||
|
case ZFS_DELEG_NOTE_SEND_RAW:
|
||||||
|
str = gettext("Allows raw (and only raw) sending of datasets."
|
||||||
|
"\n\t\t\t\tIs not really a subcommand; instead,"
|
||||||
|
"\n\t\t\t\tallows the 'send' subcommand, but only"
|
||||||
|
"\n\t\t\t\twhen with the --raw option.");
|
||||||
|
break;
|
||||||
case ZFS_DELEG_NOTE_SHARE:
|
case ZFS_DELEG_NOTE_SHARE:
|
||||||
str = gettext("Allows sharing file systems over NFS or SMB"
|
str = gettext("Allows sharing file systems over NFS or SMB"
|
||||||
"\n\t\t\t\tprotocols");
|
"\n\t\t\t\tprotocols");
|
||||||
|
|
|
@ -45,6 +45,7 @@ extern "C" {
|
||||||
#define ZFS_DELEG_PERM_MOUNT "mount"
|
#define ZFS_DELEG_PERM_MOUNT "mount"
|
||||||
#define ZFS_DELEG_PERM_SHARE "share"
|
#define ZFS_DELEG_PERM_SHARE "share"
|
||||||
#define ZFS_DELEG_PERM_SEND "send"
|
#define ZFS_DELEG_PERM_SEND "send"
|
||||||
|
#define ZFS_DELEG_PERM_SEND_RAW "send-raw"
|
||||||
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
#define ZFS_DELEG_PERM_RECEIVE "receive"
|
||||||
#define ZFS_DELEG_PERM_ALLOW "allow"
|
#define ZFS_DELEG_PERM_ALLOW "allow"
|
||||||
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
#define ZFS_DELEG_PERM_USERPROP "userprop"
|
||||||
|
|
|
@ -54,6 +54,7 @@ typedef enum {
|
||||||
ZFS_DELEG_NOTE_PROMOTE,
|
ZFS_DELEG_NOTE_PROMOTE,
|
||||||
ZFS_DELEG_NOTE_RENAME,
|
ZFS_DELEG_NOTE_RENAME,
|
||||||
ZFS_DELEG_NOTE_SEND,
|
ZFS_DELEG_NOTE_SEND,
|
||||||
|
ZFS_DELEG_NOTE_SEND_RAW,
|
||||||
ZFS_DELEG_NOTE_RECEIVE,
|
ZFS_DELEG_NOTE_RECEIVE,
|
||||||
ZFS_DELEG_NOTE_ALLOW,
|
ZFS_DELEG_NOTE_ALLOW,
|
||||||
ZFS_DELEG_NOTE_USERPROP,
|
ZFS_DELEG_NOTE_USERPROP,
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
.\" Copyright 2018 Nexenta Systems, Inc.
|
.\" Copyright 2018 Nexenta Systems, Inc.
|
||||||
.\" Copyright 2019 Joyent, Inc.
|
.\" Copyright 2019 Joyent, Inc.
|
||||||
.\"
|
.\"
|
||||||
.Dd March 16, 2022
|
.Dd December 25, 2022
|
||||||
.Dt ZFS-ALLOW 8
|
.Dt ZFS-ALLOW 8
|
||||||
.Os
|
.Os
|
||||||
.
|
.
|
||||||
|
@ -212,6 +212,7 @@ release subcommand Allows releasing a user hold which might destroy the snapshot
|
||||||
rename subcommand Must also have the \fBmount\fR and \fBcreate\fR ability in the new parent
|
rename subcommand Must also have the \fBmount\fR and \fBcreate\fR ability in the new parent
|
||||||
rollback subcommand Must also have the \fBmount\fR ability
|
rollback subcommand Must also have the \fBmount\fR ability
|
||||||
send subcommand
|
send subcommand
|
||||||
|
send-raw subcommand Allows raw (and only raw) sending of datasets. Is not really a subcommand; instead, allows the \fBsend\fR subcommand, but only when with the --raw option.
|
||||||
share subcommand Allows sharing file systems over NFS or SMB protocols
|
share subcommand Allows sharing file systems over NFS or SMB protocols
|
||||||
snapshot subcommand Must also have the \fBmount\fR ability
|
snapshot subcommand Must also have the \fBmount\fR ability
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ const zfs_deleg_perm_tab_t zfs_deleg_perm_tab[] = {
|
||||||
{ZFS_DELEG_PERM_SNAPSHOT},
|
{ZFS_DELEG_PERM_SNAPSHOT},
|
||||||
{ZFS_DELEG_PERM_SHARE},
|
{ZFS_DELEG_PERM_SHARE},
|
||||||
{ZFS_DELEG_PERM_SEND},
|
{ZFS_DELEG_PERM_SEND},
|
||||||
|
{ZFS_DELEG_PERM_SEND_RAW},
|
||||||
{ZFS_DELEG_PERM_USERPROP},
|
{ZFS_DELEG_PERM_USERPROP},
|
||||||
{ZFS_DELEG_PERM_USERQUOTA},
|
{ZFS_DELEG_PERM_USERQUOTA},
|
||||||
{ZFS_DELEG_PERM_GROUPQUOTA},
|
{ZFS_DELEG_PERM_GROUPQUOTA},
|
||||||
|
|
|
@ -714,9 +714,21 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||||
static int
|
static int
|
||||||
zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr)
|
||||||
{
|
{
|
||||||
(void) innvl;
|
int error;
|
||||||
return (zfs_secpolicy_write_perms(zc->zc_name,
|
boolean_t rawok;
|
||||||
ZFS_DELEG_PERM_SEND, cr));
|
|
||||||
|
rawok = nvlist_exists(innvl, "rawok");
|
||||||
|
|
||||||
|
error = zfs_secpolicy_write_perms(zc->zc_name, ZFS_DELEG_PERM_SEND, cr);
|
||||||
|
|
||||||
|
// If we don't have permission to send the snapshot, check the lesser
|
||||||
|
// permission of sending it raw
|
||||||
|
if ((error != 0) && rawok) {
|
||||||
|
error = zfs_secpolicy_write_perms(zc->zc_name,
|
||||||
|
ZFS_DELEG_PERM_SEND_RAW, cr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue