]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: Replace closedir() by SMB_VFS_CLOSEDIR
authorAnoop C S <anoopcs@redhat.com>
Fri, 13 Oct 2017 15:08:31 +0000 (20:38 +0530)
committerKarolin Seeger <kseeger@samba.org>
Thu, 2 Nov 2017 12:01:21 +0000 (13:01 +0100)
Pointer to directory 'dh' inside fruit_rmdir() is obtained using
SMB_VFS_OPENDIR. But this handle is closed directly by invoking
closedir() rather than SMB_VFS_CLOSEDIR. This will result in a
smbd crash if this handle was not obtained from local file system.
Therefore use SMB_VFS_CLOSEDIR corresponding to SMB_VFS_OPENDIR
to correctly close the directory handle.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13086

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Oct 16 19:56:55 CEST 2017 on sn-devel-144

(cherry picked from commit 7917f9721c9f8efdf9e7b7c50a9e5147250e36fe)

source3/modules/vfs_fruit.c

index 1890c93dcb4e31033b1ed672b69cdae419bed884..bfb265ba722d13b514593c1b3ba67c9503d69175 100644 (file)
@@ -3796,7 +3796,7 @@ static int fruit_rmdir(struct vfs_handle_struct *handle,
 
 exit_rmdir:
        if (dh) {
-               closedir(dh);
+               SMB_VFS_CLOSEDIR(handle->conn, dh);
        }
        return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
 }