From e3a867b059728a51498255115c74030052adf3ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 24 Nov 2008 18:49:37 +0100 Subject: [PATCH] s3-samr: fix init_samr_user_info{23,24} callers. Guenther (cherry picked from commit 82dfb92cae1ffc52a92ea27ba96dc875ce0ae4a1) --- source/include/proto.h | 7 +++---- source/libnet/libnet_join.c | 3 ++- source/rpc_client/init_samr.c | 13 ++++++------- source/utils/net_rpc.c | 2 +- source/utils/net_rpc_join.c | 3 ++- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/include/proto.h b/source/include/proto.h index cb2588b3ff9..e559cae53bc 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -7467,11 +7467,10 @@ void init_samr_user_info23(struct samr_UserInfo23 *r, uint8_t nt_password_set, uint8_t lm_password_set, uint8_t password_expired, - uint8_t data[516], - uint8_t pw_len); + struct samr_CryptPassword *pwd_buf); void init_samr_user_info24(struct samr_UserInfo24 *r, - uint8_t data[516], - uint8_t pw_len); + struct samr_CryptPassword *pwd_buf, + uint8_t password_expired); void init_samr_CryptPasswordEx(const char *pwd, DATA_BLOB *session_key, struct samr_CryptPasswordEx *pwd_buf); diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c index 3b6af5e3c38..6381584fa10 100644 --- a/source/libnet/libnet_join.c +++ b/source/libnet/libnet_join.c @@ -941,7 +941,8 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx, &cli->user_session_key, &crypt_pwd); - init_samr_user_info24(&user_info.info24, crypt_pwd.data, 24); + init_samr_user_info24(&user_info.info24, &crypt_pwd, + PASS_DONT_CHANGE_AT_NEXT_LOGON); status = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx, &user_pol, diff --git a/source/rpc_client/init_samr.c b/source/rpc_client/init_samr.c index 2e757531ce3..18b9d2a4352 100644 --- a/source/rpc_client/init_samr.c +++ b/source/rpc_client/init_samr.c @@ -410,8 +410,7 @@ void init_samr_user_info23(struct samr_UserInfo23 *r, uint8_t nt_password_set, uint8_t lm_password_set, uint8_t password_expired, - uint8_t data[516], - uint8_t pw_len) + struct samr_CryptPassword *pwd_buf) { memset(r, '\0', sizeof(*r)); init_samr_user_info21(&r->info, @@ -444,7 +443,7 @@ void init_samr_user_info23(struct samr_UserInfo23 *r, lm_password_set, password_expired); - memcpy(r->password.data, data, sizeof(r->password.data)); + r->password = *pwd_buf; } /************************************************************************* @@ -452,13 +451,13 @@ void init_samr_user_info23(struct samr_UserInfo23 *r, *************************************************************************/ void init_samr_user_info24(struct samr_UserInfo24 *r, - uint8_t data[516], - uint8_t pw_len) + struct samr_CryptPassword *pwd_buf, + uint8_t password_expired) { DEBUG(10, ("init_samr_user_info24:\n")); - memcpy(r->password.data, data, sizeof(r->password.data)); - r->pw_len = pw_len; + r->password = *pwd_buf; + r->password_expired = password_expired; } /************************************************************************* diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c index fb3002ea928..5b168016551 100644 --- a/source/utils/net_rpc.c +++ b/source/utils/net_rpc.c @@ -5257,7 +5257,7 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c, 0, 0, ACB_DOMTRUST, SAMR_FIELD_ACCT_FLAGS, hours, 0, 0, 0, 0, 0, 0, 0, - crypt_pwd.data, 24); + &crypt_pwd); result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx, &user_pol, diff --git a/source/utils/net_rpc_join.c b/source/utils/net_rpc_join.c index 5bc38f979f4..d8641bfb230 100644 --- a/source/utils/net_rpc_join.c +++ b/source/utils/net_rpc_join.c @@ -343,7 +343,8 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) &cli->user_session_key, &crypt_pwd); - init_samr_user_info24(&set_info.info24, crypt_pwd.data, 24); + init_samr_user_info24(&set_info.info24, &crypt_pwd, + PASS_DONT_CHANGE_AT_NEXT_LOGON); CHECK_RPC_ERR(rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx, &user_pol, -- 2.11.4.GIT