From c75396cf49bb3640b07f105b72b4ddad056bd7cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 25 Feb 2002 02:12:38 +0000 Subject: This fixes 4 info levels in a trans2 find_first that should not be null terminated for the filenames. this is what caused win2k to go into a loop sending 20000 packets to set an acl on a directory. It didn't recognise ".." with a null termination as being ".." (This used to be commit a75a2e9e2f11e27ca8a7fbad8c0108a2aee0a690) --- source3/smbd/trans2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 84ab7286e5..8e2bfd14b0 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -622,7 +622,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, *(p+2) = 0; } p += 2 + 24; - len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); + len = srvstr_push(outbuf, p, fname, -1, 0); SIVAL(q,0,len); p += len; len = PTR_DIFF(p, pdata); @@ -643,7 +643,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, p += 16; SIVAL(p,0,nt_extmode); p += 4; p += 4; - len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); + len = srvstr_push(outbuf, p, fname, -1, 0); SIVAL(p, -4, len); p += len; len = PTR_DIFF(p, pdata); @@ -666,7 +666,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, p += 4; SIVAL(p,0,0); p += 4; - len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); + len = srvstr_push(outbuf, p, fname, -1, 0); SIVAL(p, -4, len); p += len; @@ -680,7 +680,9 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn, p += 4; SIVAL(p,0,reskey); p += 4; p += 4; - len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE); + /* this must *not* be null terminated or w2k gets in a loop trying to set an + acl on a dir (tridge) */ + len = srvstr_push(outbuf, p, fname, -1, 0); SIVAL(p, -4, len); p += len; len = PTR_DIFF(p, pdata); -- cgit