kernel - Fix directory scanning bug in Samba
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Jun 2011 19:13:20 +0000 (12:13 -0700)
committerThomas Nikolajsen <thomas@dragonflybsd.org>
Wed, 6 Jul 2011 10:29:58 +0000 (12:29 +0200)
* Bring in the patch from FreeBSD PR 78953

Taken-from: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/78953
Reported-by: uv <uv.negativa@gmail.com>
sys/vfs/smbfs/smbfs_smb.c

index 8c16942..2f5cfab 100644 (file)
@@ -993,8 +993,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) {