diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index d78598d290..549a006517 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -45,7 +45,9 @@ #include #include #include +#ifdef HAVE_IDMAP #include +#endif /* HAVE_IDMAP */ #include #include @@ -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);