From ac8db3d29bf3f99a492b8265a64430538c8c1cc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Wed, 6 Feb 2008 01:53:29 +0100 Subject: [PATCH] Remove unused marshalling for SAMR_CHGPASSWD_USER. Guenther --- source/include/rpc_samr.h | 45 ---------- source/rpc_parse/parse_samr.c | 194 ------------------------------------------ 2 files changed, 239 deletions(-) diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h index 1942dd43522..63f6c27c5ef 100644 --- a/source/include/rpc_samr.h +++ b/source/include/rpc_samr.h @@ -1130,51 +1130,6 @@ typedef struct r_samr_lookup_rids_info } SAMR_R_LOOKUP_RIDS; - -/* SAMR_ENC_PASSWD */ -typedef struct enc_passwd_info -{ - uint32 ptr; - uint8 pass[516]; - -} SAMR_ENC_PASSWD; - -/* SAMR_ENC_HASH */ -typedef struct enc_hash_info -{ - uint32 ptr; - uint8 hash[16]; - -} SAMR_ENC_HASH; - -/* SAMR_Q_CHGPASSWD_USER */ -typedef struct q_samr_chgpasswd_user_info -{ - uint32 ptr_0; - - UNIHDR hdr_dest_host; /* server name unicode header */ - UNISTR2 uni_dest_host; /* server name unicode string */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNISTR2 uni_user_name; /* username unicode string */ - - SAMR_ENC_PASSWD nt_newpass; - SAMR_ENC_HASH nt_oldhash; - - uint32 unknown; /* 0x0000 0001 */ - - SAMR_ENC_PASSWD lm_newpass; - SAMR_ENC_HASH lm_oldhash; - -} SAMR_Q_CHGPASSWD_USER; - -/* SAMR_R_CHGPASSWD_USER */ -typedef struct r_samr_chgpasswd_user_info -{ - NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ - -} SAMR_R_CHGPASSWD_USER; - /* these are from the old rpc_samr.h - they are needed while the merge is still going on */ #define MAX_SAM_SIDS 15 diff --git a/source/rpc_parse/parse_samr.c b/source/rpc_parse/parse_samr.c index 5971924478a..751c8d76d94 100644 --- a/source/rpc_parse/parse_samr.c +++ b/source/rpc_parse/parse_samr.c @@ -4707,197 +4707,3 @@ bool samr_io_r_set_userinfo2(const char *desc, SAMR_R_SET_USERINFO2 * r_u, return True; } - -/******************************************************************* -make a SAMR_ENC_PASSWD structure. -********************************************************************/ - -void init_enc_passwd(SAMR_ENC_PASSWD * pwd, const char pass[512]) -{ - ZERO_STRUCTP(pwd); - - if (pass == NULL) { - pwd->ptr = 0; - } else { - pwd->ptr = 1; - memcpy(pwd->pass, pass, sizeof(pwd->pass)); - } -} - -/******************************************************************* -reads or writes a SAMR_ENC_PASSWD structure. -********************************************************************/ - -bool samr_io_enc_passwd(const char *desc, SAMR_ENC_PASSWD * pwd, - prs_struct *ps, int depth) -{ - if (pwd == NULL) - return False; - - prs_debug(ps, depth, desc, "samr_io_enc_passwd"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("ptr", ps, depth, &pwd->ptr)) - return False; - - if (pwd->ptr != 0) { - if(!prs_uint8s(False, "pwd", ps, depth, pwd->pass, sizeof(pwd->pass))) - return False; - } - - return True; -} - -/******************************************************************* -inits a SAMR_ENC_HASH structure. -********************************************************************/ - -void init_enc_hash(SAMR_ENC_HASH * hsh, const uchar hash[16]) -{ - ZERO_STRUCTP(hsh); - - if (hash == NULL) { - hsh->ptr = 0; - } else { - hsh->ptr = 1; - memcpy(hsh->hash, hash, sizeof(hsh->hash)); - } -} - -/******************************************************************* -reads or writes a SAMR_ENC_HASH structure. -********************************************************************/ - -bool samr_io_enc_hash(const char *desc, SAMR_ENC_HASH * hsh, - prs_struct *ps, int depth) -{ - if (hsh == NULL) - return False; - - prs_debug(ps, depth, desc, "samr_io_enc_hash"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("ptr ", ps, depth, &hsh->ptr)) - return False; - if (hsh->ptr != 0) { - if(!prs_uint8s(False, "hash", ps, depth, hsh->hash,sizeof(hsh->hash))) - return False; - } - - return True; -} - -/******************************************************************* -inits a SAMR_Q_CHGPASSWD_USER structure. -********************************************************************/ - -void init_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER * q_u, - const char *dest_host, const char *user_name, - const uchar nt_newpass[516], - const uchar nt_oldhash[16], - const uchar lm_newpass[516], - const uchar lm_oldhash[16]) -{ - DEBUG(5, ("init_samr_q_chgpasswd_user\n")); - - q_u->ptr_0 = 1; - init_unistr2(&q_u->uni_dest_host, dest_host, UNI_FLAGS_NONE); - init_uni_hdr(&q_u->hdr_dest_host, &q_u->uni_dest_host); - - init_unistr2(&q_u->uni_user_name, user_name, UNI_FLAGS_NONE); - init_uni_hdr(&q_u->hdr_user_name, &q_u->uni_user_name); - - init_enc_passwd(&q_u->nt_newpass, (const char *)nt_newpass); - init_enc_hash(&q_u->nt_oldhash, nt_oldhash); - - q_u->unknown = 0x01; - - init_enc_passwd(&q_u->lm_newpass, (const char *)lm_newpass); - init_enc_hash(&q_u->lm_oldhash, lm_oldhash); -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ - -bool samr_io_q_chgpasswd_user(const char *desc, SAMR_Q_CHGPASSWD_USER * q_u, - prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "samr_io_q_chgpasswd_user"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("ptr_0", ps, depth, &q_u->ptr_0)) - return False; - - if(!smb_io_unihdr("", &q_u->hdr_dest_host, ps, depth)) - return False; - if(!smb_io_unistr2("", &q_u->uni_dest_host, q_u->hdr_dest_host.buffer, ps, depth)) - return False; - - if(!prs_align(ps)) - return False; - if(!smb_io_unihdr("", &q_u->hdr_user_name, ps, depth)) - return False; - if(!smb_io_unistr2("", &q_u->uni_user_name, q_u->hdr_user_name.buffer,ps, depth)) - return False; - - if(!samr_io_enc_passwd("nt_newpass", &q_u->nt_newpass, ps, depth)) - return False; - if(!samr_io_enc_hash("nt_oldhash", &q_u->nt_oldhash, ps, depth)) - return False; - - if(!prs_uint32("unknown", ps, depth, &q_u->unknown)) - return False; - - if(!samr_io_enc_passwd("lm_newpass", &q_u->lm_newpass, ps, depth)) - return False; - if(!samr_io_enc_hash("lm_oldhash", &q_u->lm_oldhash, ps, depth)) - return False; - - return True; -} - -/******************************************************************* -inits a SAMR_R_CHGPASSWD_USER structure. -********************************************************************/ - -void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER * r_u, NTSTATUS status) -{ - DEBUG(5, ("init_samr_r_chgpasswd_user\n")); - - r_u->status = status; -} - -/******************************************************************* -reads or writes a structure. -********************************************************************/ - -bool samr_io_r_chgpasswd_user(const char *desc, SAMR_R_CHGPASSWD_USER * r_u, - prs_struct *ps, int depth) -{ - if (r_u == NULL) - return False; - - prs_debug(ps, depth, desc, "samr_io_r_chgpasswd_user"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_ntstatus("status", ps, depth, &r_u->status)) - return False; - - return True; -} -- 2.11.4.GIT