summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-03-22 20:39:31 +0000
committerJeremy Allison <jra@samba.org>2000-03-22 20:39:31 +0000
commit6814d0f45689d2a17af3d95511208421d10f5fce (patch)
treea4ae5be71672b98f19d3319af45bd82312bbb6f4 /source3/smbd
parent8f1620125dcb9c29c223f4efb6485528ece70f11 (diff)
downloadsamba-6814d0f45689d2a17af3d95511208421d10f5fce.tar.gz
samba-6814d0f45689d2a17af3d95511208421d10f5fce.tar.bz2
samba-6814d0f45689d2a17af3d95511208421d10f5fce.zip
Correctly convert from little-endian UNICODE to dos_codepage when doing
secure file create. Jeremy. (This used to be commit 90134dd13721f60d4fb05ce9434b65e95ff09629)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 05d9c82c38..1a43350e90 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -244,19 +244,6 @@ static int send_nt_replies(char *inbuf, char *outbuf, int bufsize, uint32 nt_err
strings in NT calls AND DOESN'T SET THE UNICODE BIT !!!!!!!
****************************************************************************/
-static void my_wcstombs(char *dst, uint16 *src, size_t len)
-{
- size_t i;
-
- for(i = 0; i < len; i++)
- dst[i] = (char)SVAL(src,i*2);
-}
-
-/****************************************************************************
- (Hopefully) temporary call to fix bugs in NT5.0beta2. This OS sends unicode
- strings in NT calls AND DOESN'T SET THE UNICODE BIT !!!!!!!
-****************************************************************************/
-
static void get_filename( char *fname, char *inbuf, int data_offset, int data_len, int fname_len)
{
/*
@@ -277,11 +264,11 @@ static void get_filename( char *fname, char *inbuf, int data_offset, int data_le
fname_len = fname_len/2;
if(data_offset & 1)
data_offset++;
- my_wcstombs( fname, (uint16 *)(inbuf+data_offset), fname_len);
+ pstrcpy(fname, dos_unistrn2((uint16 *)(inbuf+data_offset), fname_len));
} else {
StrnCpy(fname,inbuf+data_offset,fname_len);
+ fname[fname_len] = '\0';
}
- fname[fname_len] = '\0';
}
/****************************************************************************
@@ -312,11 +299,11 @@ static void get_filename_transact( char *fname, char *inbuf, int data_offset, in
fname_len = fname_len/2;
if(data_offset & 1)
data_offset++;
- my_wcstombs( fname, (uint16 *)(inbuf+data_offset), fname_len);
+ pstrcpy(fname, dos_unistrn2((uint16 *)(inbuf+data_offset), fname_len));
} else {
StrnCpy(fname,inbuf+data_offset,fname_len);
+ fname[fname_len] = '\0';
}
- fname[fname_len] = '\0';
}
/****************************************************************************