diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 39 | ||||
-rw-r--r-- | source3/lsarpcd/srv_lsa.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 8 | ||||
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 10 | ||||
-rw-r--r-- | source3/rpc_parse/parse_net.c | 28 | ||||
-rw-r--r-- | source3/rpc_parse/parse_reg.c | 24 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 68 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr.c | 3 |
9 files changed, 111 insertions, 73 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 1c91b92716..83bea437fa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1404,6 +1404,41 @@ struct smb_passwd *ldap_getpw(void); BOOL ldap_allocaterid(uint32 *rid); struct smb_passdb_ops *ldap_initialise_password_db(void); +/*The following definitions come from passdb/mysqlpass.c */ + +int mysql_db_lock_connect( MYSQL *handle ); +void *mysql_startpwent( BOOL update ); +void mysql_endpwent( void *ptr ); +SMB_BIG_UINT mysql_getpwpos(void *vp); +BOOL mysql_setpwpos(void *vp, SMB_BIG_UINT pos); +void *mysql_fill_smb_passwd( MYSQL_ROW *row ); +struct smb_passwd *mysql_getsmbpwent(void *vp); +void *mysql_fetch_passwd( void *(*filler)(MYSQL_ROW*), char *where ); +void *mysql_getpwuid(void *(*filler)(MYSQL_ROW *), uid_t uid); +struct smb_passwd *mysql_getsmbpwuid(uid_t uid); +void *mysql_getpwnam(void *(*filler)(MYSQL_ROW *), char *field, const char *name); +struct smb_passwd *mysql_getsmbpwnam(const char *unix_name); +BOOL mysql_del_smb( MYSQL *handle, char *unix_name ); +BOOL mysql_add_smb( MYSQL *handle, struct smb_passwd *smb ); +BOOL mysql_mod_smb( MYSQL *handle, struct smb_passwd *smb, BOOL override ); +BOOL mysql_add_smbpwd_entry(struct smb_passwd *smb); +BOOL mysql_mod_smbpwd_entry(struct smb_passwd *smb, BOOL override); +struct smb_passdb_ops *mysql_initialise_password_db(void); + +/*The following definitions come from passdb/mysqlsampass.c */ + +void *mysql_fill_sam_passwd( MYSQL_ROW *row ); +struct sam_passwd *mysql_getsampwent(void *vp); +struct sam_passwd *mysql_getsampwrid(uint32 rid); +struct sam_passwd *mysql_getsampwuid(uid_t uid); +struct sam_passwd *mysql_getsampwntnam(const char *nt_name); +struct sam_disp_info *mysql_getsamdispntnam(const char *nt_name); +struct sam_disp_info *mysql_getsamdisprid(uint32 rid); +struct sam_disp_info *mysql_getsamdispent(void *vp); +BOOL mysql_add_sampwd_entry(struct sam_passwd *sam); +BOOL mysql_mod_sampwd_entry(struct sam_passwd *sam, BOOL override); +struct sam_passdb_ops *mysql_initialise_sam_password_db(void); + /*The following definitions come from passdb/nispass.c */ struct passdb_ops *nisplus_initialise_password_db(void); @@ -1910,14 +1945,14 @@ void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); void make_strhdr2(STRHDR2 *hdr, uint32 max_len, uint32 len, uint32 buffer); void smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); +void make_uni_hdr(UNIHDR *hdr, int len); void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); void make_buf_hdr(BUFHDR *hdr, int max_len, int len); void smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset); void smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 ptr_hdrbuf, uint32 max_len, uint32 len); void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +void make_uni_hdr2(UNIHDR2 *hdr, int len); void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); void make_unistr(UNISTR *str, char *buf); void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); diff --git a/source3/lsarpcd/srv_lsa.c b/source3/lsarpcd/srv_lsa.c index 75512036b6..61aac58e62 100644 --- a/source3/lsarpcd/srv_lsa.c +++ b/source3/lsarpcd/srv_lsa.c @@ -182,7 +182,7 @@ static int make_dom_ref(DOM_R_REF *ref, char *dom_name, DOM_SID *dom_sid) len = dom_name != NULL ? strlen(dom_name) : 0; - make_uni_hdr(&(ref->hdr_ref_dom[num].hdr_dom_name), len, len, len != 0 ? 1 : 0); + make_uni_hdr(&(ref->hdr_ref_dom[num].hdr_dom_name), len); ref->hdr_ref_dom[num].ptr_dom_sid = dom_sid != NULL ? 1 : 0; make_unistr2 (&(ref->ref_dom[num].uni_dom_name), dom_name, len); diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index c5767735b0..628b6ebe4f 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -35,7 +35,7 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, int len_name = strlen(name); trn->sid_name_use = sid_name_use; - make_uni_hdr(&(trn->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(trn->hdr_name), len_name); make_unistr2(uni_name, name, len_name); trn->domain_idx = idx; } @@ -393,7 +393,7 @@ void make_q_open_secret(LSA_Q_OPEN_SECRET *q_o, POLICY_HND *pol_hnd, memcpy(&(q_o->pol), pol_hnd, sizeof(q_o->pol)); - make_uni_hdr(&(q_o->hdr_secret), len, len, 1); + make_uni_hdr(&(q_o->hdr_secret), len); make_unistr2(&(q_o->uni_secret), secret_name, len); q_o->des_access = desired_access; @@ -580,7 +580,7 @@ void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, r_e->ptr_enum_domains = 1; r_e->num_domains2 = 1; - make_uni_hdr2(&(r_e->hdr_domain_name ), len_domain_name, len_domain_name, 4); + make_uni_hdr2(&(r_e->hdr_domain_name ), len_domain_name); make_unistr2 (&(r_e->uni_domain_name ), domain_name, len_domain_name); make_dom_sid2(&(r_e->other_domain_sid), domain_sid); } @@ -852,7 +852,7 @@ void make_q_lookup_names(LSA_Q_LOOKUP_NAMES *q_l, POLICY_HND *hnd, { const char* name = names[i]; int len = strlen(name); - make_uni_hdr(&q_l->hdr_name[i], len, len, len != 0); + make_uni_hdr(&q_l->hdr_name[i], len); make_unistr2(&q_l->uni_name[i], name, len); } diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index da6ff2c7f6..323d5f65e5 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -238,11 +238,11 @@ void smb_io_strhdr2(char *desc, STRHDR2 *hdr, prs_struct *ps, int depth) /******************************************************************* creates a UNIHDR structure. ********************************************************************/ -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer) +void make_uni_hdr(UNIHDR *hdr, int len) { hdr->uni_str_len = 2 * len; - hdr->uni_max_len = 2 * max_len; - hdr->buffer = buffer; + hdr->uni_max_len = 2 * len; + hdr->buffer = len != 0 ? 1 : 0; } /******************************************************************* @@ -334,9 +334,9 @@ void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth) /******************************************************************* creates a UNIHDR2 structure. ********************************************************************/ -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate) +void make_uni_hdr2(UNIHDR2 *hdr, int len) { - make_uni_hdr(&(hdr->unihdr), max_len, len, terminate); + make_uni_hdr(&(hdr->unihdr), len); hdr->buffer = len > 0 ? 1 : 0; } diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 6c8b304a64..69d2b3bf57 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -561,13 +561,13 @@ void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, id->ptr_id_info1 = 1; - make_uni_hdr(&(id->hdr_domain_name), len_domain_name, len_domain_name, 4); + make_uni_hdr(&(id->hdr_domain_name), len_domain_name); id->param_ctrl = param_ctrl; make_logon_id(&(id->logon_id), log_id_low, log_id_high); - make_uni_hdr(&(id->hdr_user_name ), len_user_name , len_user_name , 4); - make_uni_hdr(&(id->hdr_wksta_name ), len_wksta_name , len_wksta_name , 4); + make_uni_hdr(&(id->hdr_user_name ), len_user_name ); + make_uni_hdr(&(id->hdr_wksta_name ), len_wksta_name ); if (lm_cypher && nt_cypher) { @@ -677,13 +677,13 @@ void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, id->ptr_id_info2 = 1; - make_uni_hdr(&(id->hdr_domain_name), len_domain_name, len_domain_name, 4); + make_uni_hdr(&(id->hdr_domain_name), len_domain_name); id->param_ctrl = param_ctrl; make_logon_id(&(id->logon_id), log_id_low, log_id_high); - make_uni_hdr(&(id->hdr_user_name ), len_user_name , len_user_name , 4); - make_uni_hdr(&(id->hdr_wksta_name ), len_wksta_name , len_wksta_name , 4); + make_uni_hdr(&(id->hdr_user_name ), len_user_name ); + make_uni_hdr(&(id->hdr_wksta_name ), len_wksta_name ); if (nt_chal_resp) { @@ -899,12 +899,12 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, usr->pass_can_change_time = *pass_can_change_time; usr->pass_must_change_time = *pass_must_change_time; - make_uni_hdr(&(usr->hdr_user_name ), len_user_name , len_user_name , 4); - make_uni_hdr(&(usr->hdr_full_name ), len_full_name , len_full_name , 4); - make_uni_hdr(&(usr->hdr_logon_script), len_logon_script, len_logon_script, 4); - make_uni_hdr(&(usr->hdr_profile_path), len_profile_path, len_profile_path, 4); - make_uni_hdr(&(usr->hdr_home_dir ), len_home_dir , len_home_dir , 4); - make_uni_hdr(&(usr->hdr_dir_drive ), len_dir_drive , len_dir_drive , 4); + make_uni_hdr(&(usr->hdr_user_name ), len_user_name ); + make_uni_hdr(&(usr->hdr_full_name ), len_full_name ); + make_uni_hdr(&(usr->hdr_logon_script), len_logon_script); + make_uni_hdr(&(usr->hdr_profile_path), len_profile_path); + make_uni_hdr(&(usr->hdr_home_dir ), len_home_dir ); + make_uni_hdr(&(usr->hdr_dir_drive ), len_dir_drive ); usr->logon_count = logon_count; usr->bad_pw_count = bad_pw_count; @@ -924,8 +924,8 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, bzero(usr->user_sess_key, sizeof(usr->user_sess_key)); } - make_uni_hdr(&(usr->hdr_logon_srv), len_logon_srv, len_logon_srv, 4); - make_uni_hdr(&(usr->hdr_logon_dom), len_logon_dom, len_logon_dom, 4); + make_uni_hdr(&(usr->hdr_logon_srv), len_logon_srv); + make_uni_hdr(&(usr->hdr_logon_dom), len_logon_dom); usr->buffer_dom_id = dom_sid ? 1 : 0; /* yes, we're bothering to put a domain SID in */ diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index ce0b7fff87..abb00e1572 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -161,10 +161,10 @@ void make_reg_q_create_key(REG_Q_CREATE_KEY *q_c, POLICY_HND *hnd, memcpy(&(q_c->pnt_pol), hnd, sizeof(q_c->pnt_pol)); - make_uni_hdr(&(q_c->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(q_c->hdr_name), len_name); make_unistr2(&(q_c->uni_name), name, len_name); - make_uni_hdr(&(q_c->hdr_class), len_class, len_class, 1); + make_uni_hdr(&(q_c->hdr_class), len_class); make_unistr2(&(q_c->uni_class), class, len_class); q_c->reserved = 0x00000000; @@ -249,7 +249,7 @@ void make_reg_q_delete_val(REG_Q_DELETE_VALUE *q_c, POLICY_HND *hnd, memcpy(&(q_c->pnt_pol), hnd, sizeof(q_c->pnt_pol)); - make_uni_hdr(&(q_c->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(q_c->hdr_name), len_name); make_unistr2(&(q_c->uni_name), name, len_name); } @@ -300,7 +300,7 @@ void make_reg_q_delete_key(REG_Q_DELETE_KEY *q_c, POLICY_HND *hnd, memcpy(&(q_c->pnt_pol), hnd, sizeof(q_c->pnt_pol)); - make_uni_hdr(&(q_c->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(q_c->hdr_name), len_name); make_unistr2(&(q_c->uni_name), name, len_name); } @@ -349,7 +349,9 @@ void make_reg_q_query_key(REG_Q_QUERY_KEY *q_o, POLICY_HND *hnd, ZERO_STRUCTP(q_o); memcpy(&(q_o->pol), hnd, sizeof(q_o->pol)); - make_uni_hdr(&q_o->hdr_class, max_class_len, 0, max_class_len > 0 ? 1 : 0); + q_o->hdr_class.uni_str_len = 0; + q_o->hdr_class.uni_max_len = max_class_len * 2; + q_o->hdr_class.buffer = max_class_len > 0 ? 1 : 0; q_o->uni_class.uni_max_len = max_class_len; } @@ -690,7 +692,7 @@ void make_reg_q_info(REG_Q_INFO *q_i, POLICY_HND *pol, char *product_type, memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); - make_uni_hdr(&(q_i->hdr_type), len_type, len_type, 1); + make_uni_hdr(&(q_i->hdr_type), len_type); make_unistr2(&(q_i->uni_type), product_type, len_type); q_i->ptr1 = 1; @@ -836,7 +838,9 @@ void make_reg_q_enum_val(REG_Q_ENUM_VALUE *q_i, POLICY_HND *pol, memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); q_i->val_index = val_idx; - make_uni_hdr(&q_i->hdr_name, max_val_len, 0, 1); + q_i->hdr_name.uni_str_len = 0; + q_i->hdr_name.uni_max_len = max_val_len * 2; + q_i->hdr_name.buffer = max_val_len > 0 ? 1 : 0; q_i->uni_name.uni_max_len = max_val_len; q_i->ptr_type = 1; @@ -951,7 +955,7 @@ void make_reg_q_create_val(REG_Q_CREATE_VALUE *q_i, POLICY_HND *pol, memcpy(&(q_i->pol), pol, sizeof(q_i->pol)); - make_uni_hdr(&q_i->hdr_name, val_len, val_len, 1); + make_uni_hdr(&q_i->hdr_name, val_len); make_unistr2(&(q_i->uni_name), val_name, val_len); q_i->type = type; @@ -1116,7 +1120,7 @@ void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, POLICY_HND *pol, memcpy(&(r_q->pol), pol, sizeof(r_q->pol)); - make_uni_hdr(&(r_q->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(r_q->hdr_name), len_name); make_unistr2(&(r_q->uni_name), key_name, len_name); r_q->unknown_0 = 0x00000000; @@ -1191,7 +1195,7 @@ void make_reg_q_shutdown(REG_Q_SHUTDOWN *q_i, q_i->ptr_1 = 1; q_i->ptr_2 = 1; - make_uni_hdr(&q_i->hdr_msg, len, len, 1); + make_uni_hdr(&q_i->hdr_msg, len); make_unistr2(&(q_i->uni_msg), msg, len); q_i->timeout = timeout; diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index a6069f5ff3..a2fc77981e 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -87,7 +87,7 @@ void make_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u, memcpy(&(q_u->connect_pol), pol, sizeof(*pol)); - make_uni_hdr(&(q_u->hdr_domain), len_name, len_name, 1); + make_uni_hdr(&(q_u->hdr_domain), len_name); make_unistr2(&(q_u->uni_domain), dom_name, len_name); } @@ -389,8 +389,8 @@ void make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server) u_2->unknown_2 = 0x00000000; u_2->ptr_0 = 1; - make_uni_hdr(&(u_2->hdr_domain), len_domain, len_domain, 1); - make_uni_hdr(&(u_2->hdr_server), len_server, len_server, 1); + make_uni_hdr(&(u_2->hdr_domain), len_domain); + make_uni_hdr(&(u_2->hdr_server), len_server); u_2->seq_num = 0x10000000; u_2->unknown_3 = 0x00000000; @@ -758,9 +758,9 @@ static void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, sam->acb_info = acb_info; sam->pad = 0; - make_uni_hdr(&(sam->hdr_acct_name), len_sam_name, len_sam_name, len_sam_name != 0); - make_uni_hdr(&(sam->hdr_user_name), len_sam_full, len_sam_full, len_sam_full != 0); - make_uni_hdr(&(sam->hdr_user_desc), len_sam_desc, len_sam_desc, len_sam_desc != 0); + make_uni_hdr(&(sam->hdr_acct_name), len_sam_name); + make_uni_hdr(&(sam->hdr_user_name), len_sam_full); + make_uni_hdr(&(sam->hdr_user_desc), len_sam_desc); } /******************************************************************* @@ -818,8 +818,8 @@ static void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, sam->acb_info = acb_info; sam->pad = 0; - make_uni_hdr(&(sam->hdr_srv_name), len_sam_name, len_sam_name, len_sam_name != 0); - make_uni_hdr(&(sam->hdr_srv_desc), len_sam_desc, len_sam_desc, len_sam_desc != 0); + make_uni_hdr(&(sam->hdr_srv_name), len_sam_name); + make_uni_hdr(&(sam->hdr_srv_desc), len_sam_desc); } /******************************************************************* @@ -874,8 +874,8 @@ static void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, sam->rid_grp = rid_grp; sam->attr = 0x07; /* group rid attributes - gets ignored by nt 4.0 */ - make_uni_hdr(&(sam->hdr_grp_name), len_grp_name, len_grp_name, len_grp_name != 0); - make_uni_hdr(&(sam->hdr_grp_desc), len_grp_desc, len_grp_desc, len_grp_desc != 0); + make_uni_hdr(&(sam->hdr_grp_name), len_grp_name); + make_uni_hdr(&(sam->hdr_grp_desc), len_grp_desc); } /******************************************************************* @@ -971,7 +971,7 @@ static void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid) DEBUG(5,("make_sam_entry\n")); sam->rid = rid; - make_uni_hdr(&(sam->hdr_name), len_sam_name, len_sam_name, len_sam_name != 0); + make_uni_hdr(&(sam->hdr_name), len_sam_name); } /******************************************************************* @@ -1693,12 +1693,12 @@ void make_samr_group_info1(GROUP_INFO1 *gr1, DEBUG(5,("make_samr_group_info1\n")); - make_uni_hdr(&(gr1->hdr_acct_name), acct_len , acct_len, acct_name ? 1 : 0); + make_uni_hdr(&(gr1->hdr_acct_name), acct_len); gr1->unknown_1 = 0x3; gr1->unknown_2 = 0x3; - make_uni_hdr(&(gr1->hdr_acct_desc), desc_len , desc_len, acct_desc ? 1 : 0); + make_uni_hdr(&(gr1->hdr_acct_desc), desc_len); make_unistr2(&(gr1->uni_acct_name), acct_name, acct_len); make_unistr2(&(gr1->uni_acct_desc), acct_desc, desc_len); @@ -1740,7 +1740,7 @@ void make_samr_group_info4(GROUP_INFO4 *gr4, const char *acct_desc) DEBUG(5,("make_samr_group_info4\n")); - make_uni_hdr(&(gr4->hdr_acct_desc), acct_len , acct_len, acct_desc ? 1 : 0); + make_uni_hdr(&(gr4->hdr_acct_desc), acct_len); make_unistr2(&(gr4->uni_acct_desc), acct_desc, acct_len); } @@ -1811,7 +1811,7 @@ void make_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_e, memcpy(&(q_e->pol), pol, sizeof(*pol)); - make_uni_hdr(&(q_e->hdr_acct_desc), acct_len , acct_len, acct_desc ? 1 : 0); + make_uni_hdr(&(q_e->hdr_acct_desc), acct_len); make_unistr2(&(q_e->uni_acct_desc), acct_desc, acct_len); q_e->unknown_1 = 0x0002; @@ -2685,7 +2685,7 @@ void make_samr_alias_info3(ALIAS_INFO3 *al3, const char *acct_desc) DEBUG(5,("make_samr_alias_info3\n")); - make_uni_hdr(&(al3->hdr_acct_desc), acct_len , acct_len, acct_desc ? 1 : 0); + make_uni_hdr(&(al3->hdr_acct_desc), acct_len); make_unistr2(&(al3->uni_acct_desc), acct_desc, acct_len); } @@ -3126,7 +3126,7 @@ void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, for (i = 0; i < num_names; i++) { int len = name[i] != NULL ? strlen(name[i]) : 0; - make_uni_hdr(&(r_u->hdr_name[i]), len , len, name[i] ? 1 : 0); + make_uni_hdr(&(r_u->hdr_name[i]), len); make_unistr2(&(r_u->uni_name[i]), name[i], len); r_u->type[i] = type[i]; } @@ -3258,7 +3258,7 @@ void make_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u, POLICY_HND *hnd, memcpy(&(q_u->dom_pol), hnd, sizeof(q_u->dom_pol)); - make_uni_hdr(&(q_u->hdr_acct_desc), acct_len , acct_len, acct_desc ? 1 : 0); + make_uni_hdr(&(q_u->hdr_acct_desc), acct_len); make_unistr2(&(q_u->uni_acct_desc), acct_desc, acct_len); q_u->unknown_1 = 0x001f; @@ -3593,7 +3593,7 @@ void make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, for (i = 0; i < num_names; i++) { int len_name = name[i] != NULL ? strlen(name[i]) : 0; - make_uni_hdr(&(q_u->hdr_name[i]), len_name, len_name, name[i] != NULL); /* unicode header for user_name */ + make_uni_hdr(&(q_u->hdr_name[i]), len_name); /* unicode header for user_name */ make_unistr2(&(q_u->uni_name[i]), name[i], len_name); /* unicode string for machine account */ } } @@ -3814,7 +3814,7 @@ void make_samr_q_create_user(SAMR_Q_CREATE_USER *q_u, memcpy(&q_u->domain_pol, pol, sizeof(q_u->domain_pol)); - make_uni_hdr(&(q_u->hdr_name), len_name, len_name, 1); + make_uni_hdr(&(q_u->hdr_name), len_name); make_unistr2(&(q_u->uni_name), name, len_name); q_u->acb_info = acb_info; @@ -3974,7 +3974,7 @@ void make_sam_user_info11(SAM_USER_INFO_11 *usr, memcpy(&(usr->expiry),expiry, sizeof(usr->expiry)); /* expiry time or something? */ bzero(usr->padding_1, sizeof(usr->padding_1)); /* 0 - padding 24 bytes */ - make_uni_hdr(&(usr->hdr_mach_acct), len_mach_acct, len_mach_acct, 4); /* unicode header for machine account */ + make_uni_hdr(&(usr->hdr_mach_acct), len_mach_acct); /* unicode header for machine account */ usr->padding_2 = 0; /* 0 - padding 4 bytes */ usr->ptr_1 = 1; /* pointer */ @@ -4105,16 +4105,16 @@ void make_sam_user_info21(SAM_USER_INFO_21 *usr, usr->pass_can_change_time = *pass_can_change_time; usr->pass_must_change_time = *pass_must_change_time; - make_uni_hdr(&(usr->hdr_user_name ), len_user_name , len_user_name , 1); - make_uni_hdr(&(usr->hdr_full_name ), len_full_name , len_full_name , 1); - make_uni_hdr(&(usr->hdr_home_dir ), len_home_dir , len_home_dir , 1); - make_uni_hdr(&(usr->hdr_dir_drive ), len_dir_drive , len_dir_drive , 1); - make_uni_hdr(&(usr->hdr_logon_script), len_logon_script, len_logon_script, 1); - make_uni_hdr(&(usr->hdr_profile_path), len_profile_path, len_profile_path, 1); - make_uni_hdr(&(usr->hdr_acct_desc ), len_description , len_description , 1); - make_uni_hdr(&(usr->hdr_workstations), len_workstations, len_workstations, 1); - make_uni_hdr(&(usr->hdr_unknown_str ), len_unknown_str , len_unknown_str , 1); - make_uni_hdr(&(usr->hdr_munged_dial ), len_munged_dial , len_munged_dial , 1); + make_uni_hdr(&(usr->hdr_user_name ), len_user_name ); + make_uni_hdr(&(usr->hdr_full_name ), len_full_name ); + make_uni_hdr(&(usr->hdr_home_dir ), len_home_dir ); + make_uni_hdr(&(usr->hdr_dir_drive ), len_dir_drive ); + make_uni_hdr(&(usr->hdr_logon_script), len_logon_script); + make_uni_hdr(&(usr->hdr_profile_path), len_profile_path); + make_uni_hdr(&(usr->hdr_acct_desc ), len_description ); + make_uni_hdr(&(usr->hdr_workstations), len_workstations); + make_uni_hdr(&(usr->hdr_unknown_str ), len_unknown_str ); + make_uni_hdr(&(usr->hdr_munged_dial ), len_munged_dial ); bzero(usr->nt_pwd, sizeof(usr->nt_pwd)); bzero(usr->lm_pwd, sizeof(usr->lm_pwd)); @@ -4520,7 +4520,7 @@ void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name) DEBUG(5,("make_samr_q_unknown_38\n")); q_u->ptr = 1; - make_uni_hdr(&(q_u->hdr_srv_name), len_srv_name, len_srv_name, len_srv_name != 0); + make_uni_hdr(&(q_u->hdr_srv_name), len_srv_name); make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name); } @@ -4652,9 +4652,9 @@ void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, DEBUG(5,("make_samr_q_chgpasswd_user\n")); q_u->ptr_0 = 1; - make_uni_hdr(&(q_u->hdr_dest_host), len_dest_host, len_dest_host, len_dest_host != 0); + make_uni_hdr(&(q_u->hdr_dest_host), len_dest_host); make_unistr2(&(q_u->uni_dest_host), dest_host, len_dest_host); - make_uni_hdr(&(q_u->hdr_user_name), len_user_name, len_user_name, len_user_name != 0); + make_uni_hdr(&(q_u->hdr_user_name), len_user_name); make_unistr2(&(q_u->uni_user_name), user_name, len_user_name); make_enc_passwd(&(q_u->nt_newpass), nt_newpass); diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index 75512036b6..61aac58e62 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -182,7 +182,7 @@ static int make_dom_ref(DOM_R_REF *ref, char *dom_name, DOM_SID *dom_sid) len = dom_name != NULL ? strlen(dom_name) : 0; - make_uni_hdr(&(ref->hdr_ref_dom[num].hdr_dom_name), len, len, len != 0 ? 1 : 0); + make_uni_hdr(&(ref->hdr_ref_dom[num].hdr_dom_name), len); ref->hdr_ref_dom[num].ptr_dom_sid = dom_sid != NULL ? 1 : 0; make_unistr2 (&(ref->ref_dom[num].uni_dom_name), dom_name, len); diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 0371fbc88c..2dd7801e81 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -78,8 +78,7 @@ static BOOL get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, user_name_len = strlen(pwd->nt_name); make_unistr2(&(pw_buf[(*num_entries)].uni_user_name), pwd->nt_name, user_name_len); - make_uni_hdr(&(pw_buf[(*num_entries)].hdr_user_name), user_name_len, - user_name_len, 1); + make_uni_hdr(&(pw_buf[(*num_entries)].hdr_user_name), user_name_len); pw_buf[(*num_entries)].user_rid = pwd->user_rid; bzero( pw_buf[(*num_entries)].nt_pwd , 16); |