s4-samr: merge samr_LookupNames from s3 idl. (fixme: python)
authorGünther Deschner <gd@samba.org>
Wed, 5 Nov 2008 13:28:17 +0000 (14:28 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 10 Nov 2008 20:46:30 +0000 (21:46 +0100)
Guenther

14 files changed:
librpc/idl/samr.idl
source4/libnet/groupinfo.c
source4/libnet/groupman.c
source4/libnet/libnet_join.c
source4/libnet/libnet_passwd.c
source4/libnet/userinfo.c
source4/libnet/userman.c
source4/rpc_server/samr/dcesrv_samr.c
source4/torture/libnet/libnet_group.c
source4/torture/libnet/libnet_user.c
source4/torture/libnet/utils.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samr.c
source4/torture/rpc/testjoin.c

index a84dc677bc4965f8a735035df8176438679a170a..b2c9103d97b50bddbe8c4284ea0ff833965c18c1 100644 (file)
@@ -517,8 +517,8 @@ import "misc.idl", "lsa.idl", "security.idl";
                [in,ref]      policy_handle *domain_handle,
                [in,range(0,1000)] uint32 num_names,
                [in,size_is(1000),length_is(num_names)] lsa_String names[],
-               [out]         samr_Ids rids,
-               [out]         samr_Ids types
+               [out,ref]     samr_Ids *rids,
+               [out,ref]     samr_Ids *types
                );
 
 
index 1da6646702836bd61fad3d58e9e93066793f381f..1fb52a27bc4319e8c51a9ffde3607005f7d940ae 100644 (file)
@@ -83,8 +83,8 @@ static void continue_groupinfo_lookup(struct rpc_request *req)
        if (s->monitor_fn) {
                msg.type = mon_SamrLookupName;
                msg_lookup = talloc(s, struct msg_rpc_lookup_name);
-               msg_lookup->rid = s->lookup.out.rids.ids;
-               msg_lookup->count = s->lookup.out.rids.count;
+               msg_lookup->rid = s->lookup.out.rids->ids;
+               msg_lookup->count = s->lookup.out.rids->count;
                msg.data = (void*)msg_lookup;
                msg.data_size = sizeof(*msg_lookup);
                
@@ -94,7 +94,7 @@ static void continue_groupinfo_lookup(struct rpc_request *req)
 
        /* have we actually got name resolved
           - we're looking for only one at the moment */
-       if (s->lookup.out.rids.count == 0) {
+       if (s->lookup.out.rids->count == 0) {
                composite_error(c, NT_STATUS_NO_SUCH_USER);
        }
 
@@ -103,7 +103,7 @@ static void continue_groupinfo_lookup(struct rpc_request *req)
        /* prepare parameters for LookupNames */
        s->opengroup.in.domain_handle   = &s->domain_handle;
        s->opengroup.in.access_mask     = SEC_FLAG_MAXIMUM_ALLOWED;
-       s->opengroup.in.rid             = s->lookup.out.rids.ids[0];
+       s->opengroup.in.rid             = s->lookup.out.rids->ids[0];
        s->opengroup.out.group_handle   = &s->group_handle;
 
        /* send request */
@@ -301,7 +301,11 @@ struct composite_context *libnet_rpc_groupinfo_send(struct dcerpc_pipe *p,
 
                s->lookup.in.names[0].string  = talloc_strdup(s, io->in.groupname);
                if (composite_nomem(s->lookup.in.names[0].string, c)) return c;
-               
+               s->lookup.out.rids         = talloc_zero(s, struct samr_Ids);
+               s->lookup.out.types        = talloc_zero(s, struct samr_Ids);
+               if (composite_nomem(s->lookup.out.rids, c)) return c;
+               if (composite_nomem(s->lookup.out.types, c)) return c;
+
                /* send request */
                lookup_req = dcerpc_samr_LookupNames_send(p, c, &s->lookup);
                if (composite_nomem(lookup_req, c)) return c;
index 58d574233601928923144950f6bda0683e5e7eb6..4dfb2d8aabc3a2a071c7f09d5f64116200a0eae3 100644 (file)
@@ -174,6 +174,10 @@ struct composite_context* libnet_rpc_groupdel_send(struct dcerpc_pipe *p,
        s->lookupname.in.num_names     = 1;
        s->lookupname.in.names         = talloc_zero(s, struct lsa_String);
        s->lookupname.in.names->string = io->in.groupname;
+       s->lookupname.out.rids         = talloc_zero(s, struct samr_Ids);
+       s->lookupname.out.types        = talloc_zero(s, struct samr_Ids);
+       if (composite_nomem(s->lookupname.out.rids, c)) return c;
+       if (composite_nomem(s->lookupname.out.types, c)) return c;
 
        /* send the request */
        lookup_req = dcerpc_samr_LookupNames_send(p, c, &s->lookupname);
@@ -205,12 +209,12 @@ static void continue_groupdel_name_found(struct rpc_request *req)
 
        /* what to do when there's no group account to delete
           and what if there's more than one rid resolved */
-       if (!s->lookupname.out.rids.count) {
+       if (!s->lookupname.out.rids->count) {
                c->status = NT_STATUS_NO_SUCH_GROUP;
                composite_error(c, c->status);
                return;
 
-       } else if (!s->lookupname.out.rids.count > 1) {
+       } else if (!s->lookupname.out.rids->count > 1) {
                c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
                composite_error(c, c->status);
                return;
@@ -218,7 +222,7 @@ static void continue_groupdel_name_found(struct rpc_request *req)
 
        /* prepare the arguments for rpc call */
        s->opengroup.in.domain_handle = &s->domain_handle;
-       s->opengroup.in.rid           = s->lookupname.out.rids.ids[0];
+       s->opengroup.in.rid           = s->lookupname.out.rids->ids[0];
        s->opengroup.in.access_mask   = SEC_FLAG_MAXIMUM_ALLOWED;
        s->opengroup.out.group_handle  = &s->group_handle;
 
index e18797c3d5937a4e89a6088e48ef16d36a3c0f5f..e6664b24631d84c58b9ebe289ebdcb2d693de5ac 100644 (file)
@@ -444,6 +444,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
        struct samr_OpenDomain od;
        struct policy_handle d_handle;
        struct samr_LookupNames ln;
+       struct samr_Ids rids, types;
        struct samr_OpenUser ou;
        struct samr_CreateUser2 cu;
        struct policy_handle *u_handle = NULL;
@@ -612,6 +613,8 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                ln.in.domain_handle = &d_handle;
                ln.in.num_names = 1;
                ln.in.names = talloc_array(tmp_ctx, struct lsa_String, 1);
+               ln.out.rids = &rids;
+               ln.out.types = &types;
                if (!ln.in.names) {
                        r->out.error_string = NULL;
                        talloc_free(tmp_ctx);
@@ -631,10 +634,10 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                }
                
                /* check if we got one RID for the user */
-               if (ln.out.rids.count != 1) {
+               if (ln.out.rids->count != 1) {
                        r->out.error_string = talloc_asprintf(mem_ctx,
                                                              "samr_LookupNames for [%s] returns %d RIDs",
-                                                             r->in.account_name, ln.out.rids.count);
+                                                             r->in.account_name, ln.out.rids->count);
                        talloc_free(tmp_ctx);
                        return NT_STATUS_INVALID_PARAMETER;
                }
@@ -643,7 +646,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                ZERO_STRUCTP(u_handle);
                ou.in.domain_handle = &d_handle;
                ou.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-               ou.in.rid = ln.out.rids.ids[0];
+               ou.in.rid = ln.out.rids->ids[0];
                rid = ou.in.rid;
                ou.out.user_handle = u_handle;
                
index cbb3bfadffbd738c97cb11ee1dfa8098eba689f1..d1e6fe79f4075cc3866fe6f0a5147c97344f77b0 100644 (file)
@@ -535,6 +535,7 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
        struct samr_OpenDomain od;
        struct policy_handle d_handle;
        struct samr_LookupNames ln;
+       struct samr_Ids rids, types;
        struct samr_OpenUser ou;
        struct policy_handle u_handle;
        union libnet_SetPassword r2;
@@ -602,6 +603,8 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
        ln.in.domain_handle = &d_handle;
        ln.in.num_names = 1;
        ln.in.names = talloc_array(mem_ctx, struct lsa_String, 1);
+       ln.out.rids = &rids;
+       ln.out.types = &types;
        if (!ln.in.names) {
                r->samr.out.error_string = "Out of Memory";
                return NT_STATUS_NO_MEMORY;
@@ -618,10 +621,10 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
        }
 
        /* check if we got one RID for the user */
-       if (ln.out.rids.count != 1) {
+       if (ln.out.rids->count != 1) {
                r->samr.out.error_string = talloc_asprintf(mem_ctx,
                                                "samr_LookupNames for [%s] returns %d RIDs",
-                                               r->samr.in.account_name, ln.out.rids.count);
+                                               r->samr.in.account_name, ln.out.rids->count);
                status = NT_STATUS_INVALID_PARAMETER;
                goto disconnect;        
        }
@@ -630,7 +633,7 @@ static NTSTATUS libnet_SetPassword_samr(struct libnet_context *ctx, TALLOC_CTX *
        ZERO_STRUCT(u_handle);
        ou.in.domain_handle = &d_handle;
        ou.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-       ou.in.rid = ln.out.rids.ids[0];
+       ou.in.rid = ln.out.rids->ids[0];
        ou.out.user_handle = &u_handle;
 
        /* 6. do a samr_OpenUser to get a user handle */
index e8b6b090c7c8ef3a50ca1633fcb8b74bf0c6cc7d..1579cd9691acc83e283e518951239607f8f83c48 100644 (file)
@@ -82,8 +82,8 @@ static void continue_userinfo_lookup(struct rpc_request *req)
        if (s->monitor_fn) {
                msg.type = mon_SamrLookupName;
                msg_lookup = talloc(s, struct msg_rpc_lookup_name);
-               msg_lookup->rid = s->lookup.out.rids.ids;
-               msg_lookup->count = s->lookup.out.rids.count;
+               msg_lookup->rid = s->lookup.out.rids->ids;
+               msg_lookup->count = s->lookup.out.rids->count;
                msg.data = (void*)msg_lookup;
                msg.data_size = sizeof(*msg_lookup);
                
@@ -93,7 +93,7 @@ static void continue_userinfo_lookup(struct rpc_request *req)
 
        /* have we actually got name resolved
           - we're looking for only one at the moment */
-       if (s->lookup.out.rids.count == 0) {
+       if (s->lookup.out.rids->count == 0) {
                composite_error(c, NT_STATUS_NO_SUCH_USER);
        }
 
@@ -102,7 +102,7 @@ static void continue_userinfo_lookup(struct rpc_request *req)
        /* prepare parameters for LookupNames */
        s->openuser.in.domain_handle  = &s->domain_handle;
        s->openuser.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
-       s->openuser.in.rid            = s->lookup.out.rids.ids[0];
+       s->openuser.in.rid            = s->lookup.out.rids->ids[0];
        s->openuser.out.user_handle   = &s->user_handle;
 
        /* send request */
@@ -297,6 +297,10 @@ struct composite_context *libnet_rpc_userinfo_send(struct dcerpc_pipe *p,
                s->lookup.in.num_names        = 1;
                s->lookup.in.names            = talloc_array(s, struct lsa_String, 1);
                if (composite_nomem(s->lookup.in.names, c)) return c;
+               s->lookup.out.rids         = talloc_zero(s, struct samr_Ids);
+               s->lookup.out.types        = talloc_zero(s, struct samr_Ids);
+               if (composite_nomem(s->lookup.out.rids, c)) return c;
+               if (composite_nomem(s->lookup.out.types, c)) return c;
 
                s->lookup.in.names[0].string  = talloc_strdup(s, io->in.username);
                if (composite_nomem(s->lookup.in.names[0].string, c)) return c;
index 398d9f2cb044eca244dc8ce2d0c6dd7543d04e0d..53e62c788622ddbda1d437e215d7c8691a0e1e02 100644 (file)
@@ -236,12 +236,12 @@ static void continue_userdel_name_found(struct rpc_request *req)
 
        /* what to do when there's no user account to delete
           and what if there's more than one rid resolved */
-       if (!s->lookupname.out.rids.count) {
+       if (!s->lookupname.out.rids->count) {
                c->status = NT_STATUS_NO_SUCH_USER;
                composite_error(c, c->status);
                return;
 
-       } else if (!s->lookupname.out.rids.count > 1) {
+       } else if (!s->lookupname.out.rids->count > 1) {
                c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
                composite_error(c, c->status);
                return;
@@ -251,8 +251,8 @@ static void continue_userdel_name_found(struct rpc_request *req)
        if (s->monitor_fn) {
                struct msg_rpc_lookup_name msg_lookup;
 
-               msg_lookup.rid   = s->lookupname.out.rids.ids;
-               msg_lookup.count = s->lookupname.out.rids.count;
+               msg_lookup.rid   = s->lookupname.out.rids->ids;
+               msg_lookup.count = s->lookupname.out.rids->count;
 
                msg.type      = mon_SamrLookupName;
                msg.data      = (void*)&msg_lookup;
@@ -262,7 +262,7 @@ static void continue_userdel_name_found(struct rpc_request *req)
 
        /* prepare the arguments for rpc call */
        s->openuser.in.domain_handle = &s->domain_handle;
-       s->openuser.in.rid           = s->lookupname.out.rids.ids[0];
+       s->openuser.in.rid           = s->lookupname.out.rids->ids[0];
        s->openuser.in.access_mask   = SEC_FLAG_MAXIMUM_ALLOWED;
        s->openuser.out.user_handle  = &s->user_handle;
 
@@ -393,6 +393,10 @@ struct composite_context *libnet_rpc_userdel_send(struct dcerpc_pipe *p,
        s->lookupname.in.num_names     = 1;
        s->lookupname.in.names         = talloc_zero(s, struct lsa_String);
        s->lookupname.in.names->string = io->in.username;
+       s->lookupname.out.rids         = talloc_zero(s, struct samr_Ids);
+       s->lookupname.out.types        = talloc_zero(s, struct samr_Ids);
+       if (composite_nomem(s->lookupname.out.rids, c)) return c;
+       if (composite_nomem(s->lookupname.out.types, c)) return c;
 
        /* send the request */
        lookup_req = dcerpc_samr_LookupNames_send(p, c, &s->lookupname);
@@ -500,12 +504,12 @@ static void continue_usermod_name_found(struct rpc_request *req)
 
        /* what to do when there's no user account to delete
           and what if there's more than one rid resolved */
-       if (!s->lookupname.out.rids.count) {
+       if (!s->lookupname.out.rids->count) {
                c->status = NT_STATUS_NO_SUCH_USER;
                composite_error(c, c->status);
                return;
 
-       } else if (!s->lookupname.out.rids.count > 1) {
+       } else if (!s->lookupname.out.rids->count > 1) {
                c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
                composite_error(c, c->status);
                return;
@@ -515,8 +519,8 @@ static void continue_usermod_name_found(struct rpc_request *req)
        if (s->monitor_fn) {
                struct msg_rpc_lookup_name msg_lookup;
 
-               msg_lookup.rid   = s->lookupname.out.rids.ids;
-               msg_lookup.count = s->lookupname.out.rids.count;
+               msg_lookup.rid   = s->lookupname.out.rids->ids;
+               msg_lookup.count = s->lookupname.out.rids->count;
 
                msg.type      = mon_SamrLookupName;
                msg.data      = (void*)&msg_lookup;
@@ -526,7 +530,7 @@ static void continue_usermod_name_found(struct rpc_request *req)
 
        /* prepare the next rpc call */
        s->openuser.in.domain_handle = &s->domain_handle;
-       s->openuser.in.rid           = s->lookupname.out.rids.ids[0];
+       s->openuser.in.rid           = s->lookupname.out.rids->ids[0];
        s->openuser.in.access_mask   = SEC_FLAG_MAXIMUM_ALLOWED;
        s->openuser.out.user_handle  = &s->user_handle;
 
@@ -834,6 +838,10 @@ struct composite_context *libnet_rpc_usermod_send(struct dcerpc_pipe *p,
        s->lookupname.in.num_names     = 1;
        s->lookupname.in.names         = talloc_zero(s, struct lsa_String);
        s->lookupname.in.names->string = io->in.username;
+       s->lookupname.out.rids         = talloc_zero(s, struct samr_Ids);
+       s->lookupname.out.types        = talloc_zero(s, struct samr_Ids);
+       if (composite_nomem(s->lookupname.out.rids, c)) return c;
+       if (composite_nomem(s->lookupname.out.types, c)) return c;
 
        /* send the rpc request */
        lookup_req = dcerpc_samr_LookupNames_send(p, c, &s->lookupname);
index 956c1644e8d7e9991e31f470edc713ff72cc2dc4..a8d161a5779d971ceab039187b4bd289e46f9508 100644 (file)
@@ -1877,8 +1877,8 @@ static NTSTATUS dcesrv_samr_LookupNames(struct dcesrv_call_state *dce_call, TALL
        const char * const attrs[] = { "sAMAccountType", "objectSid", NULL };
        int count;
 
-       ZERO_STRUCT(r->out.rids);
-       ZERO_STRUCT(r->out.types);
+       ZERO_STRUCTP(r->out.rids);
+       ZERO_STRUCTP(r->out.types);
 
        DCESRV_PULL_HANDLE(h, r->in.domain_handle, SAMR_HANDLE_DOMAIN);
 
@@ -1888,13 +1888,13 @@ static NTSTATUS dcesrv_samr_LookupNames(struct dcesrv_call_state *dce_call, TALL
                return NT_STATUS_OK;
        }
 
-       r->out.rids.ids = talloc_array(mem_ctx, uint32_t, r->in.num_names);
-       r->out.types.ids = talloc_array(mem_ctx, uint32_t, r->in.num_names);
-       if (!r->out.rids.ids || !r->out.types.ids) {
+       r->out.rids->ids = talloc_array(mem_ctx, uint32_t, r->in.num_names);
+       r->out.types->ids = talloc_array(mem_ctx, uint32_t, r->in.num_names);
+       if (!r->out.rids->ids || !r->out.types->ids) {
                return NT_STATUS_NO_MEMORY;
        }
-       r->out.rids.count = r->in.num_names;
-       r->out.types.count = r->in.num_names;
+       r->out.rids->count = r->in.num_names;
+       r->out.types->count = r->in.num_names;
 
        num_mapped = 0;
 
@@ -1903,8 +1903,8 @@ static NTSTATUS dcesrv_samr_LookupNames(struct dcesrv_call_state *dce_call, TALL
                struct dom_sid *sid;
                uint32_t atype, rtype;
 
-               r->out.rids.ids[i] = 0;
-               r->out.types.ids[i] = SID_NAME_UNKNOWN;
+               r->out.rids->ids[i] = 0;
+               r->out.types->ids[i] = SID_NAME_UNKNOWN;
 
                count = gendb_search(d_state->sam_ctx, mem_ctx, d_state->domain_dn, &res, attrs, 
                                     "sAMAccountName=%s", 
@@ -1933,8 +1933,8 @@ static NTSTATUS dcesrv_samr_LookupNames(struct dcesrv_call_state *dce_call, TALL
                        continue;
                }
 
-               r->out.rids.ids[i] = sid->sub_auths[sid->num_auths-1];
-               r->out.types.ids[i] = rtype;
+               r->out.rids->ids[i] = sid->sub_auths[sid->num_auths-1];
+               r->out.types->ids[i] = rtype;
                num_mapped++;
        }
        
index 12b8167a865a222559334709f743c415cb272e3e..74da6162c6a4be1dee9cdfd32db106d5d785fcda 100644 (file)
@@ -42,12 +42,15 @@ static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct lsa_String names[2];
        uint32_t rid;
        struct policy_handle group_handle;
+       struct samr_Ids rids, types;
 
        names[0].string = groupname;
 
        r1.in.domain_handle  = domain_handle;
        r1.in.num_names      = 1;
        r1.in.names          = names;
+       r1.out.rids          = &rids;
+       r1.out.types         = &types;
        
        printf("group account lookup '%s'\n", groupname);
 
@@ -57,7 +60,7 @@ static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                return false;
        }
 
-       rid = r1.out.rids.ids[0];
+       rid = r1.out.rids->ids[0];
        
        r2.in.domain_handle  = domain_handle;
        r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
index 6d3e682976f3cceb2c69be68acd6f315d5f1ce9a..98116d50f0400e68182ada808bc574bf9fd2a8c7 100644 (file)
@@ -40,12 +40,15 @@ static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct lsa_String names[2];
        uint32_t rid;
        struct policy_handle user_handle;
+       struct samr_Ids rids, types;
 
        names[0].string = username;
 
        r1.in.domain_handle  = domain_handle;
        r1.in.num_names      = 1;
        r1.in.names          = names;
+       r1.out.rids          = &rids;
+       r1.out.types         = &types;
        
        printf("user account lookup '%s'\n", username);
 
@@ -55,7 +58,7 @@ static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                return false;
        }
 
-       rid = r1.out.rids.ids[0];
+       rid = r1.out.rids->ids[0];
        
        r2.in.domain_handle  = domain_handle;
        r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
index 54c5f2c29c1bb0817b249cfd9a228ed94f4d0f3b..67ee056dbe25acd9b2bb42410991b1748f61f24f 100644 (file)
@@ -84,19 +84,22 @@ bool test_user_cleanup(struct torture_context *tctx, struct dcerpc_pipe *p,
        struct lsa_String names[2];
        uint32_t rid;
        struct policy_handle user_handle;
+       struct samr_Ids rids, types;
 
        names[0].string = name;
 
        r1.in.domain_handle  = domain_handle;
        r1.in.num_names      = 1;
        r1.in.names          = names;
+       r1.out.rids          = &rids;
+       r1.out.types         = &types;
        
        torture_comment(tctx, "user account lookup '%s'\n", name);
 
        status = dcerpc_samr_LookupNames(p, mem_ctx, &r1);
        torture_assert_ntstatus_ok(tctx, status, "LookupNames failed");
 
-       rid = r1.out.rids.ids[0];
+       rid = r1.out.rids->ids[0];
        
        r2.in.domain_handle  = domain_handle;
        r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -174,12 +177,15 @@ bool test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct lsa_String names[2];
        uint32_t rid;
        struct policy_handle group_handle;
+       struct samr_Ids rids, types;
 
        names[0].string = name;
 
        r1.in.domain_handle  = domain_handle;
        r1.in.num_names      = 1;
        r1.in.names          = names;
+       r1.out.rids          = &rids;
+       r1.out.types         = &types;
        
        printf("group account lookup '%s'\n", name);
 
@@ -189,7 +195,7 @@ bool test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                return false;
        }
 
-       rid = r1.out.rids.ids[0];
+       rid = r1.out.rids->ids[0];
        
        r2.in.domain_handle  = domain_handle;
        r2.in.access_mask    = SEC_FLAG_MAXIMUM_ALLOWED;
index c2b849127fa6574c75509422d26d3b7a93d09f79..80db2dcf0781d9b46ebe57a6dc3b14285a958ba7 100644 (file)
@@ -477,10 +477,13 @@ static NTSTATUS get_usr_handle(struct smbcli_state *cli,
        if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
                struct samr_LookupNames ln;
                struct samr_OpenUser ou;
+               struct samr_Ids rids, types;
 
                ln.in.domain_handle = &domain_handle;
                ln.in.num_names = 1;
                ln.in.names = &user_name;
+               ln.out.rids = &rids;
+               ln.out.types = &types;
 
                status = dcerpc_samr_LookupNames(samr_pipe, mem_ctx, &ln);
                if (!NT_STATUS_IS_OK(status)) {
@@ -491,7 +494,7 @@ static NTSTATUS get_usr_handle(struct smbcli_state *cli,
 
                ou.in.domain_handle = &domain_handle;
                ou.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-               user_rid = ou.in.rid = ln.out.rids.ids[0];
+               user_rid = ou.in.rid = ln.out.rids->ids[0];
                ou.out.user_handle = user_handle;
 
                status = dcerpc_samr_OpenUser(samr_pipe, mem_ctx, &ou);
index 810f37ccb804224c28404af3bc9554ea82f1f6b8..fbdcd73881055c6f548623d390c46289774d2f98 100644 (file)
@@ -967,15 +967,18 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
        NTSTATUS status;
        struct samr_LookupNames n;
        struct lsa_String sname[2];
+       struct samr_Ids rids, types;
 
        init_lsa_String(&sname[0], name);
 
        n.in.domain_handle = domain_handle;
        n.in.num_names = 1;
        n.in.names = sname;
+       n.out.rids = &rids;
+       n.out.types = &types;
        status = dcerpc_samr_LookupNames(p, tctx, &n);
        if (NT_STATUS_IS_OK(status)) {
-               *rid = n.out.rids.ids[0];
+               *rid = n.out.rids->ids[0];
        } else {
                return status;
        }
@@ -2620,11 +2623,14 @@ static bool test_ChangePassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                struct samr_QueryUserInfo q;
                struct samr_LookupNames n;
                struct policy_handle user_handle;
+               struct samr_Ids rids, types;
 
                n.in.domain_handle = domain_handle;
                n.in.num_names = 1;
                n.in.names = talloc_array(mem_ctx, struct lsa_String, 1);
                n.in.names[0].string = acct_name; 
+               n.out.rids = &rids;
+               n.out.types = &types;
 
                status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
                if (!NT_STATUS_IS_OK(status)) {
@@ -2634,12 +2640,12 @@ static bool test_ChangePassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                r.in.domain_handle = domain_handle;
                r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
-               r.in.rid = n.out.rids.ids[0];
+               r.in.rid = n.out.rids->ids[0];
                r.out.user_handle = &user_handle;
 
                status = dcerpc_samr_OpenUser(p, mem_ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("OpenUser(%u) failed - %s\n", n.out.rids.ids[0], nt_errstr(status));
+                       printf("OpenUser(%u) failed - %s\n", n.out.rids->ids[0], nt_errstr(status));
                        return false;
                }
 
@@ -3304,7 +3310,7 @@ static bool test_EnumDomainUsers(struct dcerpc_pipe *p, struct torture_context *
        struct samr_LookupNames n;
        struct samr_LookupRids  lr ;
        struct lsa_Strings names;
-       struct samr_Ids types;
+       struct samr_Ids rids, types;
 
        uint32_t masks[] = {ACB_NORMAL, ACB_DOMTRUST, ACB_WSTRUST, 
                            ACB_DISABLED, ACB_NORMAL | ACB_DISABLED, 
@@ -3348,6 +3354,8 @@ static bool test_EnumDomainUsers(struct dcerpc_pipe *p, struct torture_context *
        n.in.domain_handle = handle;
        n.in.num_names = r.out.sam->count;
        n.in.names = talloc_array(tctx, struct lsa_String, r.out.sam->count);
+       n.out.rids = &rids;
+       n.out.types = &types;
        for (i=0;i<r.out.sam->count;i++) {
                n.in.names[i].string = r.out.sam->entries[i].name.string;
        }
index d01334052820beb70cfe583f2ad545d2fd4777ca..28ce18dfca65f1cf12bcd6356c5f3d465fd4a5b6 100644 (file)
@@ -59,6 +59,7 @@ static NTSTATUS DeleteUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct policy_handle user_handle;
        uint32_t rid;
        struct samr_LookupNames n;
+       struct samr_Ids rids, types;
        struct lsa_String sname;
        struct samr_OpenUser r;
 
@@ -67,10 +68,12 @@ static NTSTATUS DeleteUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        n.in.domain_handle = handle;
        n.in.num_names = 1;
        n.in.names = &sname;
+       n.out.rids = &rids;
+       n.out.types = &types;
 
        status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
        if (NT_STATUS_IS_OK(status)) {
-               rid = n.out.rids.ids[0];
+               rid = n.out.rids->ids[0];
        } else {
                return status;
        }