diff options
author | Jim McDonough <jmcd@samba.org> | 2003-04-24 18:58:26 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2003-04-24 18:58:26 +0000 |
commit | f870072e5c6f0224ea7994387582373645c5ed86 (patch) | |
tree | 12b8026c7b826c259e8f0eecce9fc90dd76e5746 /source3/smbd | |
parent | 9530bbe2add93cd4e7f40cf38e374c64d30a735f (diff) | |
download | samba-f870072e5c6f0224ea7994387582373645c5ed86.tar.gz samba-f870072e5c6f0224ea7994387582373645c5ed86.tar.bz2 samba-f870072e5c6f0224ea7994387582373645c5ed86.zip |
Fix length in findfirst2 responses, fix os/2 clients
(This used to be commit c12feff680b183a22d933bab65b5c095c0548e7e)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/trans2.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 7b8b7e3a4f..0bfb145c10 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -626,7 +626,10 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, nameptr = p; p += align_string(outbuf, p, 0); len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); - SCVAL(nameptr, -1, len); + if (SVAL(outbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS) + SCVAL(nameptr, -1, len-2); + else + SCVAL(nameptr, -1, len-1); p += len; break; @@ -644,10 +647,13 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, SIVAL(p,l2_cbList,0); /* No extended attributes */ p += l2_achName; nameptr = p; - len = srvstr_push(outbuf, p, fname, -1, STR_NOALIGN); - SCVAL(p, -1, len); + p += align_string(outbuf, p, 0); + len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); + if (SVAL(outbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS) + SCVAL(nameptr, -1, len-2); + else + SCVAL(nameptr, -1, len-1); p += len; - *p++ = 0; /* craig from unisys pointed out we need this */ break; case SMB_FIND_FILE_BOTH_DIRECTORY_INFO: |