diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-11-25 14:45:26 +1300 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2014-12-03 04:21:09 +0100 |
commit | 7979c6cc50eaa792e5094866878c63df36e715c3 (patch) | |
tree | 114195414f6efaa628aaeb4e8c21f07199a02a0e /source3/utils | |
parent | 3b90bfb1089e6a4b7e05e7ed62bb642521f57917 (diff) | |
download | samba-7979c6cc50eaa792e5094866878c63df36e715c3.tar.gz |
idmap: unify passdb *id_to_sid methods
Instead of passing down gid or uid, a pointer to a unixid is now sent
down. This acts as an in-out variable so that the idmap functions can
correctly receive ID_TYPE_BOTH, filling in cache details correctly
rather than forcing the cache to store ID_TYPE_UID or ID_TYPE_GID.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10720
Change-Id: I11409a0f498e61a3c0a6ae606dd7af1135e6b066
Pair-programmed-with: Andrew Bartlett <abarlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_sam.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index aadabc14354..2ee9a91b704 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -30,6 +30,7 @@ #include "passdb/pdb_ldap_schema.h" #include "lib/privileges.h" #include "secrets.h" +#include "idmap.h" /* * Set a user's data @@ -912,6 +913,7 @@ static int net_sam_mapunixgroup(struct net_context *c, int argc, const char **ar static NTSTATUS unmap_unix_group(const struct group *grp) { struct dom_sid dom_sid; + struct unixid id; if (!lookup_name(talloc_tos(), grp->gr_name, LOOKUP_NAME_LOCAL, NULL, NULL, NULL, NULL)) { @@ -919,7 +921,9 @@ static NTSTATUS unmap_unix_group(const struct group *grp) return NT_STATUS_NO_SUCH_GROUP; } - if (!pdb_gid_to_sid(grp->gr_gid, &dom_sid)) { + id.id = grp->gr_gid; + id.type = ID_TYPE_GID; + if (!pdb_id_to_sid(&id, &dom_sid)) { return NT_STATUS_UNSUCCESSFUL; } |