summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-04 07:15:53 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-04 07:15:53 +0000
commit87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 (patch)
tree3c302f710cbaa03e3c0d46549e8982771b12b8a5 /source3/rpc_parse
parent9e9e73303ec10a64bd744b9b33f4e6cd7d394f03 (diff)
downloadsamba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.gz
samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.tar.bz2
samba-87fbb7092b8f8b2f0db0f361c3d625e19de57cd9.zip
The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_misc.c15
-rw-r--r--source3/rpc_parse/parse_rpc.c7
-rw-r--r--source3/rpc_parse/parse_spoolss.c2
3 files changed, 11 insertions, 13 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 4b118dd2b4..216a6e2eca 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -539,8 +539,7 @@ void init_unistr(UNISTR *str, const char *buf)
if (str->buffer == NULL)
smb_panic("init_unistr: malloc fail\n");
- /* store the string (null-terminated copy) */
- dos_struni2((char *)str->buffer, buf, len);
+ rpcstr_push(str->buffer, buf, len, STR_TERMINATE);
}
/*******************************************************************
@@ -605,12 +604,12 @@ void init_buffer3_str(BUFFER3 *str, char *buf, int len)
/* set up string lengths. */
str->buf_max_len = len * 2;
- str->buf_len = len * 2;
+ str->buf_len = len * 2;
create_buffer3(str, str->buf_max_len);
- /* store the string (null-terminated 8 bit chars into 16 bit chars) */
- dos_struni2((char *)str->buffer, buf, str->buf_max_len);
+ rpcstr_push(str->buffer, buf, str->buf_max_len, STR_TERMINATE);
+
}
/*******************************************************************
@@ -911,8 +910,7 @@ void init_unistr2(UNISTR2 *str, const char *buf, size_t len)
return;
}
- /* store the string (null-terminated 8 bit chars into 16 bit chars) */
- dos_struni2((char *)str->buffer, buf, len);
+ rpcstr_push((char *)str->buffer, buf, len, STR_TERMINATE);
}
/*******************************************************************
@@ -1483,8 +1481,7 @@ void init_unistr3(UNISTR3 *str, const char *buf)
if (str->str.buffer == NULL)
smb_panic("init_unistr3: malloc fail\n");
- /* store the string (null-terminated copy) */
- dos_struni2((char *)str->str.buffer, buf, len);
+ rpcstr_push((char *)str->str.buffer, buf, len, STR_TERMINATE);
}
/*******************************************************************
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index f330c5947e..a60bad0aa2 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -877,14 +877,15 @@ void init_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp,
memcpy(rsp->nt_resp, nt_resp, 24);
if (neg_flags & NTLMSSP_NEGOTIATE_UNICODE) {
- dos_struni2(rsp->domain, domain, sizeof(rsp->domain));
- dos_struni2(rsp->user, user, sizeof(rsp->user));
- dos_struni2(rsp->wks, wks, sizeof(rsp->wks));
+ rpcstr_push(rsp->domain, domain, sizeof(rsp->domain), 0);
+ rpcstr_push(rsp->user, user, sizeof(rsp->user), 0);
+ rpcstr_push(rsp->wks, wks, sizeof(rsp->wks), 0);
} else {
fstrcpy(rsp->domain, domain);
fstrcpy(rsp->user, user);
fstrcpy(rsp->wks, wks);
}
+
rsp->sess_key[0] = 0;
}
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 2b81a7708c..b303bf108e 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -4713,7 +4713,7 @@ static BOOL uniarray_2_dosarray(BUFFER5 *buf5, fstring **ar)
*ar = NULL;
while (src < ((char *)buf5->buffer) + buf5->buf_len*2) {
- unistr_to_dos(f, src, sizeof(f)-1);
+ rpcstr_pull(f, src, sizeof(f)-1, -1, 0);
src = skip_unibuf(src, 2*buf5->buf_len - PTR_DIFF(src,buf5->buffer));
*ar = (fstring *)Realloc(*ar, sizeof(fstring)*(n+2));
fstrcpy((*ar)[n], f);