summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_pipe.c
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-02-12 00:16:09 +0000
committerMatthew Chapman <matty@samba.org>1999-02-12 00:16:09 +0000
commitfd96929ec1fa27e0affd4c4e9ba307c4ee30b978 (patch)
tree6bfb5226bc58be39aaf7cfb954dcb472ea256a11 /source3/rpc_server/srv_pipe.c
parentf38bfc7d9aa07c4e21448aa846956bd89a259a65 (diff)
downloadsamba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.tar.gz
samba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.tar.bz2
samba-fd96929ec1fa27e0affd4c4e9ba307c4ee30b978.zip
UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination string length (especially unistrcpy was rather dangerous; we were only saved by the fact that datagrams are limited in size). (This used to be commit a1d39af1ce1d451b811dbd7c2ba391214851b87e)
Diffstat (limited to 'source3/rpc_server/srv_pipe.c')
-rw-r--r--source3/rpc_server/srv_pipe.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 5908fe06b5..07e16c7e5d 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -225,9 +225,15 @@ static BOOL api_pipe_ntlmssp_verify(pipes_struct *p)
if (IS_BITS_SET_ALL(p->ntlmssp_chal.neg_flags, NTLMSSP_NEGOTIATE_UNICODE))
{
- fstrcpy(p->user_name, unistrn2(p->ntlmssp_resp.user , p->ntlmssp_resp.hdr_usr .str_str_len/2));
- fstrcpy(p->domain , unistrn2(p->ntlmssp_resp.domain, p->ntlmssp_resp.hdr_domain.str_str_len/2));
- fstrcpy(p->wks , unistrn2(p->ntlmssp_resp.wks , p->ntlmssp_resp.hdr_wks .str_str_len/2));
+ unibuf_to_ascii(p->user_name, p->ntlmssp_resp.user,
+ MIN(p->ntlmssp_resp.hdr_usr .str_str_len/2,
+ sizeof(p->user_name)));
+ unibuf_to_ascii(p->domain , p->ntlmssp_resp.domain,
+ MIN(p->ntlmssp_resp.hdr_domain.str_str_len/2,
+ sizeof(p->domain )));
+ unibuf_to_ascii(p->wks , p->ntlmssp_resp.wks,
+ MIN(p->ntlmssp_resp.hdr_wks .str_str_len/2,
+ sizeof(p->wks )));
}
else
{