s3-samr: fix init_samr_user_info{23,24} callers.
authorGünther Deschner <gd@samba.org>
Mon, 24 Nov 2008 17:49:37 +0000 (18:49 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 10 Dec 2008 10:48:00 +0000 (11:48 +0100)
Guenther

source/libnet/libnet_join.c
source/rpc_client/init_samr.c
source/utils/net_rpc.c
source/utils/net_rpc_join.c

index 86978e4c9fb40d7c957a5c1190d1b46e6ea083f1..4cd1a40676bc3f97e3a6bf98aa0ac9b6f8292409 100644 (file)
@@ -912,7 +912,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,
index 2e757531ce3f16fd48a740b54c4801257139f446..18b9d2a43522b6a611cc10b9a752c73023ee95e7 100644 (file)
@@ -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;
 }
 
 /*************************************************************************
index 7f28eeca2eecb8253b6a6f4618f63d651f3ef6e3..d4d11de8c3c50a46c1d194e62e7129c293c3fbd1 100644 (file)
@@ -882,7 +882,8 @@ static NTSTATUS rpc_user_password_internals(const DOM_SID *domain_sid,
                                &cli->user_session_key,
                                &crypt_pwd);
 
-       init_samr_user_info24(&info.info24, crypt_pwd.data, 24);
+       init_samr_user_info24(&info.info24, &crypt_pwd,
+                             PASS_DONT_CHANGE_AT_NEXT_LOGON);
 
        result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
                                          &user_pol,
@@ -5444,7 +5445,7 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid,
                                      SAMR_FIELD_ACCT_FLAGS | SAMR_FIELD_PASSWORD,
                                      hours,
                                      0, 0, 0, 0, 0, 0, 0,
-                                     crypt_pwd.data, 24);
+                                     &crypt_pwd);
 
                result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
                                                  &user_pol,
index e178df6dcd8e03ef47a2317d940cc4c18d0bbe90..b9d7d594fe3dd5ae02e5b6da7725e27ebf9b8301 100644 (file)
@@ -339,7 +339,8 @@ int net_rpc_join_newstyle(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,