From cc518d3b677c959c629e4575cbe788373339924a Mon Sep 17 00:00:00 2001 From: Boris Popov Date: Tue, 22 Nov 2005 07:13:00 +0000 Subject: [PATCH] Fix interaction with Windows 2000/XP based servers: If the complete reply on the TRANS2_FIND_FIRST2 request fits exactly into one responce packet, then next call to TRANS2_FIND_NEXT2 will return zero entries and server will close current transaction. To avoid subsequent errors we should not perform FIND_CLOSE2 request. PR: kern/78953 Submitted by: Jim Carroll --- sys/fs/smbfs/smbfs_smb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c index f45d2ace476f..61129bd6f48a 100644 --- a/sys/fs/smbfs/smbfs_smb.c +++ b/sys/fs/smbfs/smbfs_smb.c @@ -1224,8 +1224,10 @@ smbfs_smb_trans2find2(struct smbfs_fctx *ctx) return error; if ((error = md_get_uint16le(mdp, &tw)) != 0) return error; - if (ctx->f_ecnt == 0) + if (ctx->f_ecnt == 0) { + ctx->f_flags |= SMBFS_RDD_EOF | SMBFS_RDD_NOCLOSE; return ENOENT; + } ctx->f_rnameofs = tw; mdp = &t2p->t2_rdata; if (mdp->md_top == NULL) {