ctr->switch_value));
memset(&dummy_rtn_creds, '\0', sizeof(dummy_rtn_creds));
+ dummy_rtn_creds.timestamp.time = time(NULL);
/* store the parameters */
make_sam_info(&(q_s.sam_id), cli->srv_name_slash, global_myname,
if (buf != NULL)
{
*ptr = 1;
- make_unistr2(str, buf, strlen(buf));
+ make_unistr2(str, buf, strlen(buf)+1);
}
else
{
********************************************************************/
void make_unistr2(UNISTR2 *str, char *buf, int len)
{
- /* set up string lengths. add one if string is not null-terminated */
- str->uni_max_len = len+1;
+ /* set up string lengths. */
+ str->uni_max_len = len;
str->undoc = 0;
- str->uni_str_len = len+1;
+ str->uni_str_len = len;
/* store the string (null-terminated 8 bit chars into 16 bit chars) */
struni2(str->buffer, buf);
if (logon_srv != NULL)
{
log->undoc_buffer = 1;
- make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv));
+ make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv)+1);
}
else
{
if (comp_name != NULL)
{
log->undoc_buffer2 = 1;
- make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name));
+ make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name)+1);
}
else
{
log->undoc_buffer = 1;
- make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv));
- make_unistr2(&(log->uni_acct_name), acct_name, strlen(acct_name));
+ make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv)+1);
+ make_unistr2(&(log->uni_acct_name), acct_name, strlen(acct_name)+1);
log->sec_chan = sec_chan;
- make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name));
+ make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name)+1);
}
/*******************************************************************
if (trusted_dc_name != NULL)
{
- make_unistr2(&(info->uni_trusted_dc_name), trusted_dc_name, len_dc_name);
+ make_unistr2(&(info->uni_trusted_dc_name), trusted_dc_name, len_dc_name+1);
}
else
{
fstring domain_name;
fstrcpy(domain_name, dom_name);
strupper(domain_name);
- make_unistr2(&(r_t->uni_trust_dom_name[i]), domain_name, strlen(domain_name));
+ make_unistr2(&(r_t->uni_trust_dom_name[i]), domain_name, strlen(domain_name)+1);
/* the use of UNISTR2 here is non-standard. */
r_t->uni_trust_dom_name[i].undoc = 0x1;
}
q_c->undoc_buffer = 1; /* don't know what this buffer is */
- make_unistr2(&(q_c->uni_logon_srv ), logon_srv , strlen(logon_srv ));
- make_unistr2(&(q_c->uni_logon_clnt), logon_clnt, strlen(logon_clnt));
+ make_unistr2(&(q_c->uni_logon_srv ), logon_srv , strlen(logon_srv )+1);
+ make_unistr2(&(q_c->uni_logon_clnt), logon_clnt, strlen(logon_clnt)+1);
memcpy(q_c->clnt_chal.data, clnt_chal->data, sizeof(clnt_chal->data));
prs_uint32("undoc_buffer", ps, depth, &(q_c->undoc_buffer));
- smb_io_unistr2("", &(q_c->uni_logon_srv), True, ps, depth); /* logon server unicode string */
+ smb_io_unistr2("", &(q_c->uni_logon_srv ), True, ps, depth); /* logon server unicode string */
smb_io_unistr2("", &(q_c->uni_logon_clnt), True, ps, depth); /* logon client unicode string */
old_align = ps->align;
/* make PDC server name \\server */
q_u->ptr_srv_name = len_srv_name > 0 ? 1 : 0;
- make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name);
+ make_unistr2(&(q_u->uni_srv_name), srv_name, len_srv_name+1);
/* example values: 0x0000 0002 */
q_u->unknown_0 = unknown_0;
break;
}
}
+ prs_align(ps);
}
}
got_grps = True;
num_entries = 1;
- make_unistr2(&(pass[0].uni_user_name), dummy_group, strlen(dummy_group));
+ make_unistr2(&(pass[0].uni_user_name), dummy_group, strlen(dummy_group)-1);
pass[0].user_rid = DOMAIN_GROUP_RID_ADMINS;
if (r_e.status == 0 && got_grps)
char *name;
while (num_entries < MAX_SAM_ENTRIES && ((name = builtin_alias_rids[num_entries].name) != NULL))
{
- make_unistr2(&(pass[num_entries].uni_user_name), name, strlen(name));
+ make_unistr2(&(pass[num_entries].uni_user_name), name, strlen(name)-1);
pass[num_entries].user_rid = builtin_alias_rids[num_entries].rid;
num_entries++;
}