zfs allow/unallow should work with numeric uid/gid
And that should work even (especially) if there is no matching user or group name. The change is originally by Xin Lin <delphij@FreeBSD.org>. Original-patch-by: Xin Li <delphij@FreeBSD.org> Reviewed-by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed-by: Andy Stormont <astormont@racktopsystems.com> Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Andriy Gapon <avg@FreeBSD.org> Closes #9792 Closes #10280
This commit is contained in:
parent
2e6af52b2e
commit
a8bd6dcf87
|
@ -5238,10 +5238,17 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nice_name != NULL)
|
if (nice_name != NULL) {
|
||||||
(void) strlcpy(
|
(void) strlcpy(
|
||||||
node->who_perm.who_ug_name,
|
node->who_perm.who_ug_name,
|
||||||
nice_name, 256);
|
nice_name, 256);
|
||||||
|
} else {
|
||||||
|
/* User or group unknown */
|
||||||
|
(void) snprintf(
|
||||||
|
node->who_perm.who_ug_name,
|
||||||
|
sizeof (node->who_perm.who_ug_name),
|
||||||
|
"(unknown: %d)", rid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uu_avl_insert(avl, node, idx);
|
uu_avl_insert(avl, node, idx);
|
||||||
|
@ -5773,9 +5780,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts *opts, nvlist_t **nvlp)
|
||||||
|
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
rid = p->pw_uid;
|
rid = p->pw_uid;
|
||||||
else {
|
else if (*endch != '\0') {
|
||||||
(void) snprintf(errbuf, 256, gettext(
|
(void) snprintf(errbuf, 256, gettext(
|
||||||
"invalid user %s"), curr);
|
"invalid user %s\n"), curr);
|
||||||
allow_usage(un, B_TRUE, errbuf);
|
allow_usage(un, B_TRUE, errbuf);
|
||||||
}
|
}
|
||||||
} else if (opts->group) {
|
} else if (opts->group) {
|
||||||
|
@ -5787,9 +5794,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts *opts, nvlist_t **nvlp)
|
||||||
|
|
||||||
if (g != NULL)
|
if (g != NULL)
|
||||||
rid = g->gr_gid;
|
rid = g->gr_gid;
|
||||||
else {
|
else if (*endch != '\0') {
|
||||||
(void) snprintf(errbuf, 256, gettext(
|
(void) snprintf(errbuf, 256, gettext(
|
||||||
"invalid group %s"), curr);
|
"invalid group %s\n"), curr);
|
||||||
allow_usage(un, B_TRUE, errbuf);
|
allow_usage(un, B_TRUE, errbuf);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -5815,7 +5822,7 @@ construct_fsacl_list(boolean_t un, struct allow_opts *opts, nvlist_t **nvlp)
|
||||||
rid = g->gr_gid;
|
rid = g->gr_gid;
|
||||||
} else {
|
} else {
|
||||||
(void) snprintf(errbuf, 256, gettext(
|
(void) snprintf(errbuf, 256, gettext(
|
||||||
"invalid user/group %s"), curr);
|
"invalid user/group %s\n"), curr);
|
||||||
allow_usage(un, B_TRUE, errbuf);
|
allow_usage(un, B_TRUE, errbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue