summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 06:15:18 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 06:15:18 +0000
commit96c795cea7518b50a40caba34e656f056a832589 (patch)
treea75d467bddd17c322b932734549db27cf1cf56fa /source3/rpc_server
parentec879eacc263043409b584797d1e8c39258ba125 (diff)
downloadsamba-96c795cea7518b50a40caba34e656f056a832589.tar.gz
samba-96c795cea7518b50a40caba34e656f056a832589.tar.bz2
samba-96c795cea7518b50a40caba34e656f056a832589.zip
reverted this patch till I sort out the craziness with UNIHDR
(This used to be commit e3d00fa47d38cd214f5e350e1d6b30d90ed8a52c)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_dfs_nt.c12
-rw-r--r--source3/rpc_server/srv_lsa_nt.c23
-rw-r--r--source3/rpc_server/srv_samr_nt.c8
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c2
4 files changed, 24 insertions, 21 deletions
diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c
index 38a26d1988..da92e5c06b 100644
--- a/source3/rpc_server/srv_dfs_nt.c
+++ b/source3/rpc_server/srv_dfs_nt.c
@@ -198,7 +198,7 @@ static BOOL init_reply_dfs_info_1(struct junction_map* j, DFS_INFO_1* dfs1, int
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
DEBUG(5,("init_reply_dfs_info_1: %d) initing entrypath: %s\n",i,str));
- init_unistr2(&dfs1[i].entrypath,str);
+ init_unistr2(&dfs1[i].entrypath,str,strlen(str)+1);
}
return True;
}
@@ -212,7 +212,7 @@ static BOOL init_reply_dfs_info_2(struct junction_map* j, DFS_INFO_2* dfs2, int
dfs2[i].ptr_entrypath = 1;
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
- init_unistr2(&dfs2[i].entrypath, str);
+ init_unistr2(&dfs2[i].entrypath, str, strlen(str)+1);
dfs2[i].ptr_comment = 0;
dfs2[i].state = 1; /* set up state of dfs junction as OK */
dfs2[i].num_storages = j[i].referral_count;
@@ -234,9 +234,9 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, DFS_I
slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(),
j[i].service_name, j[i].volume_name);
- init_unistr2(&dfs3[i].entrypath, str);
+ init_unistr2(&dfs3[i].entrypath, str, strlen(str)+1);
dfs3[i].ptr_comment = 1;
- init_unistr2(&dfs3[i].comment, "");
+ init_unistr2(&dfs3[i].comment, "", 1);
dfs3[i].state = 1;
dfs3[i].num_storages = dfs3[i].num_storage_infos = j[i].referral_count;
dfs3[i].ptr_storages = 1;
@@ -267,8 +267,8 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, DFS_I
*p = '\0';
DEBUG(5,("storage %d: %s.%s\n",ii,path,p+1));
stor->state = 2; /* set all storages as ONLINE */
- init_unistr2(&stor->servername, path);
- init_unistr2(&stor->sharename, p+1);
+ init_unistr2(&stor->servername, path, strlen(path)+1);
+ init_unistr2(&stor->sharename, p+1, strlen(p+1)+1);
stor->ptr_servername = stor->ptr_sharename = 1;
}
}
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 07a04dabb0..fc51d7ef2f 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -77,7 +77,7 @@ static void init_dom_query(DOM_QUERY *d_q, const char *dom_name, DOM_SID *dom_si
d_q->buffer_dom_sid = dom_sid != NULL ? 1 : 0; /* domain sid pointer */
/* this string is supposed to be character short */
- init_unistr2(&d_q->uni_domain_name, dom_name);
+ init_unistr2(&d_q->uni_domain_name, dom_name, domlen);
d_q->uni_domain_name.uni_max_len++;
if (dom_sid != NULL)
@@ -121,7 +121,7 @@ static int init_dom_ref(DOM_R_REF *ref, char *dom_name, DOM_SID *dom_sid)
init_uni_hdr(&ref->hdr_ref_dom[num].hdr_dom_name, len);
ref->hdr_ref_dom[num].ptr_dom_sid = dom_sid != NULL ? 1 : 0;
- init_unistr2(&ref->ref_dom[num].uni_dom_name, dom_name);
+ init_unistr2(&ref->ref_dom[num].uni_dom_name, dom_name, len);
init_dom_sid2(&ref->ref_dom[num].ref_dom, dom_sid );
return num;
@@ -350,21 +350,24 @@ static void init_dns_dom_info(LSA_DNS_DOM_INFO *r_l, const char *nb_name,
{
if (nb_name && *nb_name) {
init_uni_hdr(&r_l->hdr_nb_dom_name, strlen(nb_name));
- init_unistr2(&r_l->uni_nb_dom_name, nb_name);
+ init_unistr2(&r_l->uni_nb_dom_name, nb_name,
+ strlen(nb_name));
r_l->hdr_nb_dom_name.uni_max_len += 2;
r_l->uni_nb_dom_name.uni_max_len += 1;
}
if (dns_name && *dns_name) {
init_uni_hdr(&r_l->hdr_dns_dom_name, strlen(dns_name));
- init_unistr2(&r_l->uni_dns_dom_name, dns_name);
+ init_unistr2(&r_l->uni_dns_dom_name, dns_name,
+ strlen(dns_name));
r_l->hdr_dns_dom_name.uni_max_len += 2;
r_l->uni_dns_dom_name.uni_max_len += 1;
}
if (forest_name && *forest_name) {
init_uni_hdr(&r_l->hdr_forest_name, strlen(forest_name));
- init_unistr2(&r_l->uni_forest_name, forest_name);
+ init_unistr2(&r_l->uni_forest_name, forest_name,
+ strlen(forest_name));
r_l->hdr_forest_name.uni_max_len += 2;
r_l->uni_forest_name.uni_max_len += 1;
}
@@ -767,12 +770,12 @@ NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIV
for (i = 0; i < PRIV_ALL_INDEX; i++, entry++) {
if( i<enum_context) {
init_uni_hdr(&entry->hdr_name, 0);
- init_unistr2(&entry->name, NULL);
+ init_unistr2(&entry->name, NULL, 0 );
entry->luid_low = 0;
entry->luid_high = 0;
} else {
init_uni_hdr(&entry->hdr_name, strlen(privs[i+1].priv));
- init_unistr2(&entry->name, privs[i+1].priv);
+ init_unistr2(&entry->name, privs[i+1].priv, strlen(privs[i+1].priv) );
entry->luid_low = privs[i+1].se_priv;
entry->luid_high = 0;
}
@@ -815,7 +818,7 @@ NTSTATUS _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, L
if (privs[i].se_priv!=SE_PRIV_ALL) {
DEBUG(10,(": %s\n", privs[i].description));
init_uni_hdr(&r_u->hdr_desc, strlen(privs[i].description));
- init_unistr2(&r_u->desc, privs[i].description);
+ init_unistr2(&r_u->desc, privs[i].description, strlen(privs[i].description) );
r_u->ptr_info=0xdeadbeef;
r_u->lang_id=q_u->lang_id;
@@ -896,13 +899,13 @@ NTSTATUS _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA
init_uni_hdr(&r_u->hdr_user_name, ulen);
r_u->ptr_user_name = 1;
- init_unistr2(&r_u->uni2_user_name, username);
+ init_unistr2(&r_u->uni2_user_name, username, ulen);
r_u->unk1 = 1;
init_uni_hdr(&r_u->hdr_dom_name, dlen);
r_u->ptr_dom_name = 1;
- init_unistr2(&r_u->uni2_dom_name, domname);
+ init_unistr2(&r_u->uni2_dom_name, domname, dlen);
r_u->status = NT_STATUS_OK;
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 74361fd931..2896fd79e4 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -717,7 +717,7 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UN
for (i = 0; i < num_entries; i++) {
pwd = disp_user_info[i+start_idx].sam;
temp_name = pdb_get_username(pwd);
- init_unistr2(&uni_temp_name, temp_name);
+ init_unistr2(&uni_temp_name, temp_name, strlen(temp_name)+1);
user_sid = pdb_get_user_sid(pwd);
if (!sid_peek_check_rid(domain_sid, user_sid, &user_rid)) {
@@ -866,7 +866,7 @@ static void make_group_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UNIST
int len = strlen(grp[i].name)+1;
init_sam_entry(&sam[i], len, grp[i].rid);
- init_unistr2(&uni_name[i], grp[i].name);
+ init_unistr2(&uni_name[i], grp[i].name, len);
}
*sam_pp = sam;
@@ -1574,7 +1574,7 @@ static BOOL make_samr_lookup_rids(TALLOC_CTX *ctx, uint32 num_names, fstring nam
int len = names[i] != NULL ? strlen(names[i]) : 0;
DEBUG(10, ("names[%d]:%s\n", i, names[i]));
init_uni_hdr(&hdr_name[i], len);
- init_unistr2(&uni_name[i], names[i]);
+ init_unistr2(&uni_name[i], names[i], len);
}
*pp_uni_name = uni_name;
@@ -2555,7 +2555,7 @@ static BOOL make_enum_domains(TALLOC_CTX *ctx, SAM_ENTRY **pp_sam,
int len = doms[i] != NULL ? strlen(doms[i]) : 0;
init_sam_entry(&sam[i], len, 0);
- init_unistr2(&uni_name[i], doms[i]);
+ init_unistr2(&uni_name[i], doms[i], len);
}
*pp_sam = sam;
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index fd85d2f429..b44910883c 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -666,7 +666,7 @@ static void notify_string(struct spoolss_notify_msg *msg,
/* The length of the message includes the trailing \0 */
- init_unistr2(&unistr, msg->notify.data);
+ init_unistr2(&unistr, msg->notify.data, msg->len);
data->notify_data.data.length = msg->len * 2;
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, msg->len * 2);