idmap-autorid: Not necessary to talloc domainsid
authorVolker Lendecke <vl@samba.org>
Tue, 8 Mar 2011 20:17:37 +0000 (21:17 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 18 Mar 2011 14:46:36 +0000 (15:46 +0100)
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
source3/winbindd/idmap_autorid.c

index f720a46fd19a14ddd911a7434277396015a85154..d4618a9716b7c90acf6a96f15ff885b8bbe86872 100644 (file)
@@ -273,16 +273,13 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
 {
        struct autorid_global_config *global;
        struct autorid_domain_config *domaincfg;
-       struct dom_sid *domainsid;
        struct winbindd_tdc_domain *domain;
-       uint32_t rid;
        TALLOC_CTX *ctx;
        NTSTATUS ret;
        int i;
 
        ctx = talloc_new(dom);
-       domainsid = talloc(ctx, struct dom_sid);
-       if (!ctx || !domainsid) {
+       if (!ctx) {
                DEBUG(0, ("Out of memory!\n"));
                ret = NT_STATUS_NO_MEMORY;
                goto failure;
@@ -304,19 +301,21 @@ static NTSTATUS idmap_autorid_sids_to_unixids(struct idmap_domain *dom,
                                 struct autorid_global_config);
 
        for (i = 0; ids[i]; i++) {
-               ZERO_STRUCTP(domainsid);
-               sid_copy(domainsid, ids[i]->sid);
-               if (!sid_split_rid(domainsid, &rid)) {
+               struct dom_sid domainsid;
+               uint32_t rid;
+
+               sid_copy(&domainsid, ids[i]->sid);
+               if (!sid_split_rid(&domainsid, &rid)) {
                        DEBUG(4, ("Could not determine domain SID from %s, "
                                  "ignoring mapping request\n",
                                  sid_string_dbg(ids[i]->sid)));
                        continue;
                }
 
-               domain = wcache_tdc_fetch_domainbysid(ctx, domainsid);
+               domain = wcache_tdc_fetch_domainbysid(ctx, &domainsid);
                if (domain == NULL) {
                        DEBUG(10, ("Ignoring unknown domain sid %s\n",
-                                  sid_string_dbg(domainsid)));
+                                  sid_string_dbg(&domainsid)));
                        continue;
                }