summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-07 21:24:00 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-07 21:24:00 +0000
commit1cc543ffa1306cf5038e67dfe9b8727ab23c31f3 (patch)
treea865bf91d6bfb39803b14fedda7e5e6fdc5f104c /source3/smbd
parent74e99216289956bef5d13f4a691b749933eadfa2 (diff)
downloadsamba-1cc543ffa1306cf5038e67dfe9b8727ab23c31f3.tar.gz
samba-1cc543ffa1306cf5038e67dfe9b8727ab23c31f3.tar.bz2
samba-1cc543ffa1306cf5038e67dfe9b8727ab23c31f3.zip
fixed some unicode and LANMAN2 bugs in trans2 find first/next
(This used to be commit d5097b2f20c55ddcf4ae8da4d1d0a2fe91938a6b)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 622b23c0b0..e914a974fb 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -471,8 +471,9 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
SSVAL(p,l1_attrFile,mode);
p += l1_achName;
nameptr = p;
+ p += align_string(outbuf, p, 0);
len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
- SCVAL(p, -1, len);
+ SCVAL(nameptr, -1, len);
p += len;
break;
@@ -492,46 +493,9 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
p += l2_achName;
nameptr = p;
len = srvstr_push(outbuf, p, fname, -1,
- STR_TERMINATE);
- SCVAL(p, -1, len);
- p += len;
- break;
-
- case 3:
- SIVAL(p,0,reskey);
- put_dos_date2(p,4,cdate);
- put_dos_date2(p,8,adate);
- put_dos_date2(p,12,mdate);
- SIVAL(p,16,(uint32)size);
- SIVAL(p,20,SMB_ROUNDUP(size,1024));
- SSVAL(p,24,mode);
- SIVAL(p,26,4);
- p += 31;
- nameptr = p;
- len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
- SCVAL(p, -1, len);
- p += len;
- break;
-
- case 4:
- if(requires_resume_key) {
- SIVAL(p,0,reskey);
- p += 4;
- }
- q = p;
- put_dos_date2(p,4,cdate);
- put_dos_date2(p,8,adate);
- put_dos_date2(p,12,mdate);
- SIVAL(p,16,(uint32)size);
- SIVAL(p,20,SMB_ROUNDUP(size,1024));
- SSVAL(p,24,mode);
- p += 33;
- nameptr = p;
- len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
+ STR_NOALIGN);
SCVAL(p, -1, len);
p += len;
- SIVAL(q,4,PTR_DIFF(p, q));
-
break;
case SMB_FIND_FILE_BOTH_DIRECTORY_INFO: