svn commit: r361496 - stable/12/cddl/contrib/opensolaris/cmd/zfs
Andriy Gapon
avg at FreeBSD.org
Tue May 26 05:55:46 UTC 2020
Author: avg
Date: Tue May 26 05:55:46 2020
New Revision: 361496
URL: https://svnweb.freebsd.org/changeset/base/361496
Log:
MFC r360956: zfs allow/unallow should work with numeric uid/gid
And that should work even (especially) if there is no matching user or
group name. This change allows to see and modify delegations for
deleted groups and users.
The change is originally by Xin Li.
illumos report: https://www.illumos.org/issues/6037
OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280
Modified:
stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 26 05:54:00 2020 (r361495)
+++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 26 05:55:46 2020 (r361496)
@@ -4693,6 +4693,14 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
(void) strlcpy(
node->who_perm.who_ug_name,
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);
@@ -5191,9 +5199,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts *
if (p != NULL)
rid = p->pw_uid;
- else {
+ else if (*endch != '\0') {
(void) snprintf(errbuf, 256, gettext(
- "invalid user %s"), curr);
+ "invalid user %s\n"), curr);
allow_usage(un, B_TRUE, errbuf);
}
} else if (opts->group) {
@@ -5205,9 +5213,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts *
if (g != NULL)
rid = g->gr_gid;
- else {
+ else if (*endch != '\0') {
(void) snprintf(errbuf, 256, gettext(
- "invalid group %s"), curr);
+ "invalid group %s\n"), curr);
allow_usage(un, B_TRUE, errbuf);
}
} else {
@@ -5233,7 +5241,7 @@ construct_fsacl_list(boolean_t un, struct allow_opts *
rid = g->gr_gid;
} else {
(void) snprintf(errbuf, 256, gettext(
- "invalid user/group %s"), curr);
+ "invalid user/group %s\n"), curr);
allow_usage(un, B_TRUE, errbuf);
}
}
More information about the svn-src-all
mailing list