mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-13 03:30:34 +03:00
Fix get/set users/groups in quota props via numeric id
Fix setting/getting users/groups in quota properties through numeric identifier. This support was accidentally disabled in the original port by applying the HAVE_IDMAP wrapper macro too broadly. Fix obtained by moving #ifdef HAVE_IDMAP to exclude only the part of code that really needs IDMAP. Now zfs (get|set) (user|group)quota@1000 works as expected. Signed-off-by: Massimo Maggi <massimo@mmmm.it> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1147
This commit is contained in:
parent
fd7fd5ebcf
commit
5e6320cd12
@ -2532,29 +2532,29 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
|
|||||||
return (ENOSYS);
|
return (ENOSYS);
|
||||||
#endif /* HAVE_IDMAP */
|
#endif /* HAVE_IDMAP */
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_IDMAP
|
|
||||||
/* It's a user/group ID (eg "12345"). */
|
/* It's a user/group ID (eg "12345"). */
|
||||||
uid_t id;
|
uid_t id;
|
||||||
idmap_rid_t rid;
|
|
||||||
char *mapdomain;
|
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
id = strtoul(cp, &end, 10);
|
id = strtoul(cp, &end, 10);
|
||||||
if (*end != '\0')
|
if (*end != '\0')
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
if (id > MAXUID) {
|
if (id > MAXUID) {
|
||||||
|
#ifdef HAVE_IDMAP
|
||||||
/* It's an ephemeral ID. */
|
/* It's an ephemeral ID. */
|
||||||
|
idmap_rid_t rid;
|
||||||
|
char *mapdomain;
|
||||||
|
|
||||||
if (idmap_id_to_numeric_domain_rid(id, isuser,
|
if (idmap_id_to_numeric_domain_rid(id, isuser,
|
||||||
&mapdomain, &rid) != 0)
|
&mapdomain, &rid) != 0)
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
(void) strlcpy(domain, mapdomain, domainlen);
|
(void) strlcpy(domain, mapdomain, domainlen);
|
||||||
*ridp = rid;
|
*ridp = rid;
|
||||||
|
#else
|
||||||
|
return (ENOSYS);
|
||||||
|
#endif /* HAVE_IDMAP */
|
||||||
} else {
|
} else {
|
||||||
*ridp = id;
|
*ridp = id;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
return (ENOSYS);
|
|
||||||
#endif /* HAVE_IDMAP */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user