s4-samr: merge samr_GetDomPwInfo from s3 idl. (fixme: python)
authorGünther Deschner <gd@samba.org>
Wed, 5 Nov 2008 00:34:55 +0000 (01:34 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 10 Nov 2008 20:46:28 +0000 (21:46 +0100)
Guenther

librpc/idl/samr.idl
source4/rpc_server/samr/dcesrv_samr.c
source4/torture/rpc/samr.c
source4/torture/rpc/schannel.c

index 7fb3d95ea20f716f93fe82a21d1bc6cf41004a29..708ceabb5f5a0cfc1ea13297d7282d84866abe0c 100644 (file)
@@ -1312,7 +1312,7 @@ import "misc.idl", "lsa.idl", "security.idl";
        /* Function    0x38     */
        NTSTATUS samr_GetDomPwInfo(
                [in,unique] lsa_String *domain_name,
-               [out]       samr_PwInfo info
+               [out,ref]   samr_PwInfo *info
                );
 
        /************************/
index 2cd3f8896ebc24e9400cf81b67a4fced3f0a1b47..45998b9ebd8edc10e85e1e632db07241825aa3cf 100644 (file)
@@ -4156,7 +4156,7 @@ static NTSTATUS dcesrv_samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TAL
        const char * const attrs[] = {"minPwdLength", "pwdProperties", NULL };
        struct ldb_context *sam_ctx;
 
-       ZERO_STRUCT(r->out.info);
+       ZERO_STRUCTP(r->out.info);
 
        sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info); 
        if (sam_ctx == NULL) {
@@ -4174,8 +4174,8 @@ static NTSTATUS dcesrv_samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TAL
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
 
-       r->out.info.min_password_length = samdb_result_uint(msgs[0], "minPwdLength", 0);
-       r->out.info.password_properties = samdb_result_uint(msgs[0], "pwdProperties", 1);
+       r->out.info->min_password_length = samdb_result_uint(msgs[0], "minPwdLength", 0);
+       r->out.info->password_properties = samdb_result_uint(msgs[0], "pwdProperties", 1);
 
        talloc_free(msgs);
 
index aebef28a19d37ffceb4e7b45e3bf7ecaeb405053..ce631283c27229a496d49bcb9fad22e684cb61d1 100644 (file)
@@ -909,8 +909,11 @@ static bool test_GetDomPwInfo(struct dcerpc_pipe *p, struct torture_context *tct
 {
        NTSTATUS status;
        struct samr_GetDomPwInfo r;
+       struct samr_PwInfo info;
 
        r.in.domain_name = domain_name;
+       r.out.info = &info;
+
        torture_comment(tctx, "Testing GetDomPwInfo with name %s\n", r.in.domain_name->string);
 
        status = dcerpc_samr_GetDomPwInfo(p, tctx, &r);
@@ -1399,12 +1402,14 @@ static bool test_OemChangePasswordUser2(struct dcerpc_pipe *p, struct torture_co
        uint8_t old_lm_hash[16], new_lm_hash[16];
 
        struct samr_GetDomPwInfo dom_pw_info;
+       struct samr_PwInfo info;
        int policy_min_pw_len = 0;
 
        struct lsa_String domain_name;
 
        domain_name.string = "";
        dom_pw_info.in.domain_name = &domain_name;
+       dom_pw_info.out.info = &info;
 
        torture_comment(tctx, "Testing OemChangePasswordUser2\n");
 
@@ -1415,7 +1420,7 @@ static bool test_OemChangePasswordUser2(struct dcerpc_pipe *p, struct torture_co
 
        status = dcerpc_samr_GetDomPwInfo(p, tctx, &dom_pw_info);
        if (NT_STATUS_IS_OK(status)) {
-               policy_min_pw_len = dom_pw_info.out.info.min_password_length;
+               policy_min_pw_len = dom_pw_info.out.info->min_password_length;
        }
 
        newpass = samr_rand_pass(tctx, policy_min_pw_len);
@@ -1568,11 +1573,13 @@ static bool test_ChangePasswordUser2(struct dcerpc_pipe *p, struct torture_conte
        uint8_t old_lm_hash[16], new_lm_hash[16];
 
        struct samr_GetDomPwInfo dom_pw_info;
+       struct samr_PwInfo info;
 
        struct lsa_String domain_name;
 
        domain_name.string = "";
        dom_pw_info.in.domain_name = &domain_name;
+       dom_pw_info.out.info = &info;
 
        torture_comment(tctx, "Testing ChangePasswordUser2 on %s\n", acct_name);
 
@@ -1584,7 +1591,7 @@ static bool test_ChangePasswordUser2(struct dcerpc_pipe *p, struct torture_conte
                int policy_min_pw_len = 0;
                status = dcerpc_samr_GetDomPwInfo(p, tctx, &dom_pw_info);
                if (NT_STATUS_IS_OK(status)) {
-                       policy_min_pw_len = dom_pw_info.out.info.min_password_length;
+                       policy_min_pw_len = dom_pw_info.out.info->min_password_length;
                }
 
                newpass = samr_rand_pass(tctx, policy_min_pw_len);
index ca1655729bd017d4e8f1b5fd56eabe9695ee5e83..451990a71bcb702754bc740a38e9d183a8f0fa74 100644 (file)
@@ -128,6 +128,7 @@ static bool test_samr_ops(struct torture_context *tctx,
 {
        NTSTATUS status;
        struct samr_GetDomPwInfo r;
+       struct samr_PwInfo info;
        struct samr_Connect connect;
        struct samr_OpenDomain opendom;
        int i;
@@ -137,6 +138,7 @@ static bool test_samr_ops(struct torture_context *tctx,
 
        name.string = lp_workgroup(tctx->lp_ctx);
        r.in.domain_name = &name;
+       r.out.info = &info;
 
        connect.in.system_name = 0;
        connect.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;