summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-06-26 06:39:54 +0000
committerAndrew Tridgell <tridge@samba.org>2002-06-26 06:39:54 +0000
commit788c2c655baab3bf87cd984a8599b0829029f6c2 (patch)
treeae386f77234c1e9b04bb959c553d23823f9692fb
parent12658bc7257732b28ffe8e18a47b1527df693510 (diff)
downloadsamba-788c2c655baab3bf87cd984a8599b0829029f6c2.tar.gz
samba-788c2c655baab3bf87cd984a8599b0829029f6c2.tar.bz2
samba-788c2c655baab3bf87cd984a8599b0829029f6c2.zip
fixed 3 bugs in jeremys trans2 merge. Hopefully it now works.
(This used to be commit 4a7813711130625598e0ffe92e7938890b818d2f)
-rw-r--r--source3/smbd/trans2.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 67d1f3121f..f1dfb39aac 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -200,8 +200,6 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf, i
int16 open_ofun;
int32 open_size;
char *pname;
- int16 namelen;
-
pstring fname;
mode_t unixmode;
SMB_OFF_T size=0;
@@ -231,8 +229,6 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf, i
open_size = IVAL(params,14);
pname = &params[28];
- StrnCpy(fname,pname,namelen);
-
srvstr_pull(inbuf, fname, pname, sizeof(fname), -1, STR_TERMINATE);
DEBUG(3,("trans2open %s mode=%d attr=%d ofun=%d size=%d\n",
@@ -1680,12 +1676,13 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
sbuf.st_mtime &= ~1;
}
- /* NT expects the name to be in an exact form */
+ /* NT expects the name to be in an exact form of the *full*
+ filename. See the trans2 torture test */
if (strequal(base_name,".")) {
pstrcpy(dos_fname, "\\");
} else {
- snprintf(dos_fname, sizeof(dos_fname), "\\%s", base_name);
- string_replace( dos_fname, '/', '\\');
+ snprintf(dos_fname, sizeof(dos_fname), "\\%s", fname);
+ string_replace(dos_fname, '/', '\\');
}
switch (info_level) {
@@ -1918,7 +1915,6 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
data_size = 0;
} else {
size_t byte_len = dos_PutUniCode(pdata+24,"::$DATA", 0xE, False);
- SSVAL(outbuf,smb_flg2,SVAL(outbuf,smb_flg2)|FLAGS2_UNICODE_STRINGS);
SIVAL(pdata,0,0); /* ??? */
SIVAL(pdata,4,byte_len); /* Byte length of unicode string ::$DATA */
SOFF_T(pdata,8,size);