diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-07-07 21:24:00 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-07-07 21:24:00 +0000 |
commit | d5097b2f20c55ddcf4ae8da4d1d0a2fe91938a6b (patch) | |
tree | 6680f2effb607cfe52e0c20e286678184e282113 | |
parent | dc99b9ddf847c210c72921ba1dedcdc34fd32aab (diff) | |
download | samba-d5097b2f20c55ddcf4ae8da4d1d0a2fe91938a6b.tar.gz samba-d5097b2f20c55ddcf4ae8da4d1d0a2fe91938a6b.tar.xz samba-d5097b2f20c55ddcf4ae8da4d1d0a2fe91938a6b.zip |
fixed some unicode and LANMAN2 bugs in trans2 find first/next
-rw-r--r-- | source/smbd/trans2.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 622b23c0b02..e914a974fbc 100644 --- a/source/smbd/trans2.c +++ b/source/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: |