s4-samr: fix samr passwdord_expired callers.
authorGünther Deschner <gd@samba.org>
Thu, 27 Nov 2008 16:45:01 +0000 (17:45 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 28 Nov 2008 12:55:49 +0000 (13:55 +0100)
Guenther

source4/libnet/libnet_passwd.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samr.c
source4/torture/rpc/testjoin.c

index 976606e72cf5f7cd3ef574fcdb02ed39ab9ae170..80de6134b58c64dccef29940fa5010da21491024 100644 (file)
@@ -307,7 +307,7 @@ static NTSTATUS libnet_SetPassword_samr_handle_26(struct libnet_context *ctx, TA
        /* prepare samr_SetUserInfo2 level 26 */
        ZERO_STRUCT(u_info);
        encode_pw_buffer(u_info.info26.password.data, r->samr_handle.in.newpassword, STR_UNICODE);
-       u_info.info26.pw_len = strlen(r->samr_handle.in.newpassword);
+       u_info.info26.password_expired = 0;
        
        status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
        if (!NT_STATUS_IS_OK(status)) {
@@ -410,8 +410,7 @@ static NTSTATUS libnet_SetPassword_samr_handle_24(struct libnet_context *ctx, TA
        /* prepare samr_SetUserInfo2 level 24 */
        ZERO_STRUCT(u_info);
        encode_pw_buffer(u_info.info24.password.data, r->samr_handle.in.newpassword, STR_UNICODE);
-       /* w2k3 ignores this length */
-       u_info.info24.pw_len = strlen_m(r->samr_handle.in.newpassword)*2;
+       u_info.info24.password_expired = 0;
 
        status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
        if (!NT_STATUS_IS_OK(status)) {
index 1148262dfe3e94bee0adc040d16274ffb445ec50..f1e7e5a367013ffe6ced2c95c1dbf32172733a91 100644 (file)
@@ -768,6 +768,10 @@ static bool join3(struct smbcli_state *cli,
                i21->acct_flags = ACB_WSTRUST;
                i21->fields_present = SAMR_FIELD_FULL_NAME |
                        SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_PASSWORD;
+               /* this would break the test result expectations
+               i21->fields_present |= SAMR_FIELD_EXPIRED_FLAG;
+               i21->password_expired = 1;
+               */
 
                encode_pw_buffer(u_info.info25.password.data,
                                 cli_credentials_get_password(wks_creds),
@@ -808,8 +812,8 @@ static bool join3(struct smbcli_state *cli,
                encode_pw_buffer(u_info.info24.password.data,
                                 cli_credentials_get_password(wks_creds),
                                 STR_UNICODE);
-               u_info.info24.pw_len =
-                       strlen_m(cli_credentials_get_password(wks_creds))*2;
+               /* just to make this test pass */
+               u_info.info24.password_expired = 1;
 
                status = dcerpc_fetch_session_key(samr_pipe, &session_key);
                if (!NT_STATUS_IS_OK(status)) {
index 87690178a73246bcc4dc45e59f77a71770274720..6115c0c2a1e8074d66e6daa8d51ec473c16a7023 100644 (file)
@@ -570,8 +570,7 @@ static bool test_SetUserPass(struct dcerpc_pipe *p, struct torture_context *tctx
        s.in.level = 24;
 
        encode_pw_buffer(u.info24.password.data, newpass, STR_UNICODE);
-       /* w2k3 ignores this length */
-       u.info24.pw_len = strlen_m(newpass) * 2;
+       u.info24.password_expired = 0;
 
        status = dcerpc_fetch_session_key(p, &session_key);
        if (!NT_STATUS_IS_OK(status)) {
@@ -709,7 +708,7 @@ static bool test_SetUserPassEx(struct dcerpc_pipe *p, struct torture_context *tc
        s.in.level = 26;
 
        encode_pw_buffer(u.info26.password.data, newpass, STR_UNICODE);
-       u.info26.pw_len = strlen(newpass);
+       u.info26.password_expired = 0;
 
        status = dcerpc_fetch_session_key(p, &session_key);
        if (!NT_STATUS_IS_OK(status)) {
index 3b56d5b0ad9dbb615e2c6edff0a5315e7b539b4b..c93358015caae1a17c6a968f72e35f1aff0e810a 100644 (file)
@@ -247,7 +247,7 @@ again:
        s.in.level = 24;
 
        encode_pw_buffer(u.info24.password.data, random_pw, STR_UNICODE);
-       u.info24.pw_len = strlen(random_pw);
+       u.info24.password_expired = 0;
 
        status = dcerpc_fetch_session_key(join->p, &session_key);
        if (!NT_STATUS_IS_OK(status)) {