mirror of
https://github.com/samba-team/samba.git
synced 2025-05-28 21:05:48 +03:00
s4-samr: fix samr callers after SAMR_FIELD_PASSWORD change.
Guenther
This commit is contained in:
parent
7423b6a4b8
commit
4bcf8edcf8
@ -360,7 +360,7 @@ static NTSTATUS libnet_SetPassword_samr_handle_25(struct libnet_context *ctx, TA
|
||||
/* prepare samr_SetUserInfo2 level 25 */
|
||||
ZERO_STRUCT(u_info);
|
||||
u_info.info25.info = *r->samr_handle.in.info21;
|
||||
u_info.info25.info.fields_present |= SAMR_FIELD_PASSWORD;
|
||||
u_info.info25.info.fields_present |= SAMR_FIELD_NT_PASSWORD_PRESENT;
|
||||
encode_pw_buffer(u_info.info25.password.data, r->samr_handle.in.newpassword, STR_UNICODE);
|
||||
|
||||
status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
|
||||
@ -451,7 +451,7 @@ static NTSTATUS libnet_SetPassword_samr_handle_23(struct libnet_context *ctx, TA
|
||||
/* prepare samr_SetUserInfo2 level 23 */
|
||||
ZERO_STRUCT(u_info);
|
||||
u_info.info23.info = *r->samr_handle.in.info21;
|
||||
u_info.info23.info.fields_present |= SAMR_FIELD_PASSWORD;
|
||||
u_info.info23.info.fields_present |= SAMR_FIELD_NT_PASSWORD_PRESENT;
|
||||
encode_pw_buffer(u_info.info23.password.data, r->samr_handle.in.newpassword, STR_UNICODE);
|
||||
|
||||
status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
|
||||
|
@ -3511,14 +3511,14 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
|
||||
SET_UINT (msg, info23.info.country_code, "countryCode");
|
||||
IFSET(SAMR_FIELD_CODE_PAGE)
|
||||
SET_UINT (msg, info23.info.code_page, "codePage");
|
||||
IFSET(SAMR_FIELD_PASSWORD) {
|
||||
IFSET(SAMR_FIELD_NT_PASSWORD_PRESENT) {
|
||||
status = samr_set_password(dce_call,
|
||||
a_state->sam_ctx,
|
||||
a_state->account_dn,
|
||||
a_state->domain_state->domain_dn,
|
||||
mem_ctx, msg,
|
||||
&r->in.info->info23.password);
|
||||
} else IFSET(SAMR_FIELD_PASSWORD2) {
|
||||
} else IFSET(SAMR_FIELD_LM_PASSWORD_PRESENT) {
|
||||
status = samr_set_password(dce_call,
|
||||
a_state->sam_ctx,
|
||||
a_state->account_dn,
|
||||
@ -3567,14 +3567,14 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
|
||||
SET_UINT (msg, info25.info.country_code, "countryCode");
|
||||
IFSET(SAMR_FIELD_CODE_PAGE)
|
||||
SET_UINT (msg, info25.info.code_page, "codePage");
|
||||
IFSET(SAMR_FIELD_PASSWORD) {
|
||||
IFSET(SAMR_FIELD_NT_PASSWORD_PRESENT) {
|
||||
status = samr_set_password_ex(dce_call,
|
||||
a_state->sam_ctx,
|
||||
a_state->account_dn,
|
||||
a_state->domain_state->domain_dn,
|
||||
mem_ctx, msg,
|
||||
&r->in.info->info25.password);
|
||||
} else IFSET(SAMR_FIELD_PASSWORD2) {
|
||||
} else IFSET(SAMR_FIELD_LM_PASSWORD_PRESENT) {
|
||||
status = samr_set_password_ex(dce_call,
|
||||
a_state->sam_ctx,
|
||||
a_state->account_dn,
|
||||
|
@ -580,8 +580,8 @@ static bool create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
|
||||
arcfour_crypt_blob(u_info.info23.password.data, 516,
|
||||
&session_key);
|
||||
u_info.info23.info.password_expired = 0;
|
||||
u_info.info23.info.fields_present = SAMR_FIELD_PASSWORD |
|
||||
SAMR_FIELD_PASSWORD2 |
|
||||
u_info.info23.info.fields_present = SAMR_FIELD_NT_PASSWORD_PRESENT |
|
||||
SAMR_FIELD_LM_PASSWORD_PRESENT |
|
||||
SAMR_FIELD_EXPIRED_FLAG;
|
||||
sui2.in.user_handle = wks_handle;
|
||||
sui2.in.info = &u_info;
|
||||
@ -767,7 +767,7 @@ static bool join3(struct smbcli_state *cli,
|
||||
cli_credentials_get_workstation(wks_creds));
|
||||
i21->acct_flags = ACB_WSTRUST;
|
||||
i21->fields_present = SAMR_FIELD_FULL_NAME |
|
||||
SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_PASSWORD;
|
||||
SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_NT_PASSWORD_PRESENT;
|
||||
/* this would break the test result expectations
|
||||
i21->fields_present |= SAMR_FIELD_EXPIRED_FLAG;
|
||||
i21->password_expired = 1;
|
||||
|
@ -2074,7 +2074,7 @@ bool test_ChangePasswordRandomBytes(struct dcerpc_pipe *p, struct torture_contex
|
||||
|
||||
ZERO_STRUCT(u);
|
||||
|
||||
u.info25.info.fields_present = SAMR_FIELD_PASSWORD;
|
||||
u.info25.info.fields_present = SAMR_FIELD_NT_PASSWORD_PRESENT;
|
||||
|
||||
set_pw_in_buffer(u.info25.password.data, &new_random_pass);
|
||||
|
||||
@ -2669,9 +2669,9 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p,
|
||||
* password has been changed, old and new pwdlastset
|
||||
* need to be the same value */
|
||||
|
||||
if (!(pwd_tests[i].fields_present & SAMR_FIELD_EXPIRED_FLAG) &&
|
||||
!((pwd_tests[i].fields_present & SAMR_FIELD_PASSWORD) ||
|
||||
(pwd_tests[i].fields_present & SAMR_FIELD_PASSWORD2)))
|
||||
if (!(fields_present[f] & SAMR_FIELD_EXPIRED_FLAG) &&
|
||||
!((fields_present[f] & SAMR_FIELD_NT_PASSWORD_PRESENT) ||
|
||||
(fields_present[f] & SAMR_FIELD_LM_PASSWORD_PRESENT)))
|
||||
{
|
||||
torture_assert_int_equal(tctx, pwdlastset_old,
|
||||
pwdlastset_new, "pwdlastset must be equal");
|
||||
@ -2732,9 +2732,9 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p,
|
||||
* password has been changed, old and new pwdlastset
|
||||
* need to be the same value */
|
||||
|
||||
if (!(pwd_tests[i].fields_present & SAMR_FIELD_EXPIRED_FLAG) &&
|
||||
!((pwd_tests[i].fields_present & SAMR_FIELD_PASSWORD) ||
|
||||
(pwd_tests[i].fields_present & SAMR_FIELD_PASSWORD2)))
|
||||
if (!(fields_present[f] & SAMR_FIELD_EXPIRED_FLAG) &&
|
||||
!((fields_present[f] & SAMR_FIELD_NT_PASSWORD_PRESENT) ||
|
||||
(fields_present[f] & SAMR_FIELD_LM_PASSWORD_PRESENT)))
|
||||
{
|
||||
torture_assert_int_equal(tctx, pwdlastset_old,
|
||||
pwdlastset_new, "pwdlastset must be equal");
|
||||
@ -2787,9 +2787,9 @@ static bool test_user_ops(struct dcerpc_pipe *p,
|
||||
int i;
|
||||
uint32_t rid;
|
||||
const uint32_t password_fields[] = {
|
||||
SAMR_FIELD_PASSWORD,
|
||||
SAMR_FIELD_PASSWORD2,
|
||||
SAMR_FIELD_PASSWORD | SAMR_FIELD_PASSWORD2,
|
||||
SAMR_FIELD_NT_PASSWORD_PRESENT,
|
||||
SAMR_FIELD_LM_PASSWORD_PRESENT,
|
||||
SAMR_FIELD_NT_PASSWORD_PRESENT | SAMR_FIELD_LM_PASSWORD_PRESENT,
|
||||
0
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user