From 9661d3808895606f5b2ee27267bdd614e14a5d15 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 7 Jul 2009 13:16:24 -0700 Subject: [PATCH] Add topic branch to conditionally remove idmap support. The only things currently like this on linux appears in the nfs v4 implementation of idmap. For now we can do with out. --- .topdeps | 4 +--- .topmsg | 17 ++--------------- lib/libzfs/libzfs_dataset.c | 12 ++++++++++++ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.topdeps b/.topdeps index 607c231780..7f16cbcdd5 100644 --- a/.topdeps +++ b/.topdeps @@ -1,3 +1 @@ -gcc-branch -fix-branch -feature-branch +zfs-branch diff --git a/.topmsg b/.topmsg index 03967cdff5..99071c09b0 100644 --- a/.topmsg +++ b/.topmsg @@ -1,19 +1,6 @@ From: Brian Behlendorf -Subject: [PATCH] zfs branch +Subject: [PATCH] linux have idmap -Merged result of all changes which are relevant to both Solaris -and Linux builds of the ZFS code. These are changes where there -is a reasonable chance they will be accepted upstream. - -Additionally, since this is effectively the root of the linux -ZFS tree the core linux build system is added here. This -includes autogen.sh, configure.ac, m4 macros, some scripts/*, -and makefiles for all the core ZFS components. Linux-only -features which require tweaks to the build system should appear -on the relevant topic branches. All autotools products which -result from autogen.sh are commited to the linux-configure-branch. - -This branch also contains the META, ChangeLog, AUTHORS, TODO, -and README, files. +Use idmap service if available. Signed-off-by: Brian Behlendorf diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index b9dc73ec98..23b4850462 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 @@ -1996,6 +1998,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) @@ -2030,6 +2033,7 @@ out: (void) idmap_fini(idmap_hdl); return (err); } +#endif /* HAVE_IDMAP */ /* * convert the propname into parameters needed by kernel @@ -2062,6 +2066,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 @@ -2082,6 +2087,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); @@ -2114,6 +2122,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; @@ -2131,6 +2140,9 @@ userquota_propname_decode(const char *propname, boolean_t zoned, } else { *ridp = id; } +#else + return (ENOSYS); +#endif /* HAVE_IDMAP */ } return (0);