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>
Fri, 28 Nov 2008 12:55:38 +0000 (13:55 +0100)
Guenther

source3/include/proto.h
source3/libnet/libnet_join.c
source3/rpc_client/init_samr.c
source3/utils/net_rpc.c
source3/utils/net_rpc_join.c

index 59df098d0da579aacf15c77d99c7e6cb3533b53a..0087b5bb4d30e60d76bc2920cca972326865aac5 100644 (file)
@@ -5733,11 +5733,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);
index bd127f8607619fbe7ab4eae97a870ab09e7c9b1f..498c7af3f0593863e77949e7f0a57a9abcc3ed4f 100644 (file)
@@ -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,
index 43809c03d10fb7a1fda3dbdeb40876e4d61b107c..19dd0b3c094f57d982066f4c813b0a0c45748b97 100644 (file)
@@ -457,8 +457,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,
@@ -491,7 +490,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;
 }
 
 /*************************************************************************
@@ -499,13 +498,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 8c79cea021a6c044b7354f8767c5ccf0ebceb13f..3c8ce0326e66bc4ed8dbd3e09ec07aee7c475228 100644 (file)
@@ -5253,7 +5253,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,
index 2fe464a0005a08a5a3f33bf0af48ad8952450e6b..8070a6282b7ee7b39da4c42d0698c21c9c6f8c92 100644 (file)
@@ -339,7 +339,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,