summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-12-19 12:35:32 -0800
committerKarolin Seeger <kseeger@samba.org>2017-03-22 10:48:06 +0100
commite413f14abdc26d2d214e06b5b4407b126a74ec4c (patch)
tree876b542b33eecf88d986da02a4f7b2ae42aae3f8
parent2594b8bdccb4aecc69c1e01399b006c1abc6d7ad (diff)
downloadsamba-e413f14abdc26d2d214e06b5b4407b126a74ec4c.tar.gz
CVE-2017-2619: s3: smbd: Correctly fallback to open_dir_safely if FDOPENDIR not supported on system.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12496 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
-rw-r--r--source3/smbd/dir.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 2fd50850665..1348d12298c 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1797,20 +1797,15 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
}
if (dirp->dir == NULL) {
- /* FDOPENDIR didn't work. Use OPENDIR instead. */
- dirp->dir = SMB_VFS_OPENDIR(conn,
- dirp->dir_smb_fname,
+ /* FDOPENDIR is not supported. Use OPENDIR instead. */
+ TALLOC_FREE(dirp);
+ return open_dir_safely(mem_ctx,
+ conn,
+ fsp->fsp_name,
mask,
attr);
}
- if (!dirp->dir) {
- DEBUG(5,("OpenDir_fsp: Can't open %s. %s\n",
- dirp->dir_smb_fname->base_name,
- strerror(errno) ));
- goto fail;
- }
-
if (sconn && !sconn->using_smb2) {
sconn->searches.dirhandles_open++;
}