Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch

This commit is contained in:
Brian Behlendorf 2009-07-07 13:27:52 -07:00
commit b26bf77fe0
1 changed files with 12 additions and 0 deletions

View File

@ -45,7 +45,9 @@
#include <grp.h>
#include <stddef.h>
#include <ucred.h>
#ifdef HAVE_IDMAP
#include <idmap.h>
#endif /* HAVE_IDMAP */
#include <aclutils.h>
#include <sys/spa.h>
@ -1998,6 +2000,7 @@ zfs_prop_get_numeric(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t *value,
return (0);
}
#ifdef HAVE_IDMAP
static int
idmap_id_to_numeric_domain_rid(uid_t id, boolean_t isuser,
char **domainp, idmap_rid_t *ridp)
@ -2032,6 +2035,7 @@ out:
(void) idmap_fini(idmap_hdl);
return (err);
}
#endif /* HAVE_IDMAP */
/*
* convert the propname into parameters needed by kernel
@ -2064,6 +2068,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
cp = strchr(propname, '@') + 1;
if (strchr(cp, '@')) {
#ifdef HAVE_IDMAP
/*
* It's a SID name (eg "user@domain") that needs to be
* turned into S-1-domainID-RID. There should be a
@ -2084,6 +2089,9 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
return (ENOENT);
(void) strlcpy(domain, mapdomain, domainlen);
*ridp = rid;
#else
return (ENOSYS);
#endif /* HAVE_IDMAP */
} else if (strncmp(cp, "S-1-", 4) == 0) {
/* It's a numeric SID (eg "S-1-234-567-89") */
(void) strcpy(domain, cp);
@ -2116,6 +2124,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
*ridp = gr->gr_gid;
}
} else {
#ifdef HAVE_IDMAP
/* It's a user/group ID (eg "12345"). */
uid_t id = strtoul(cp, &end, 10);
idmap_rid_t rid;
@ -2133,6 +2142,9 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
} else {
*ridp = id;
}
#else
return (ENOSYS);
#endif /* HAVE_IDMAP */
}
return (0);