From 749db9a4059a3150a97ca55766abed81786141f9 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 13 Oct 2017 20:38:31 +0530 Subject: [PATCH] vfs_fruit: Replace closedir() by SMB_VFS_CLOSEDIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison Reviewed-by: Guenther Deschner Autobuild-User(master): Günther Deschner 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index df0a7007636..a1b4783978c 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -3561,7 +3561,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); } -- 2.13.6