From 21d4aec1ad34c0a34f5024ff9d8c11213ff030e9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 9 Jun 2021 12:01:03 -0700 Subject: [PATCH] s3: smbd: open_directory(). Cleanup. We don't need 'int flags' here. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/open.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 3e48a9f35de..daedb4a2c07 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4386,7 +4386,6 @@ static NTSTATUS open_directory(connection_struct *conn, NTSTATUS status; struct timespec mtimespec; int info = 0; - int flags; bool ok; if (is_ntfs_stream_smb_fname(smb_dname)) { @@ -4580,13 +4579,7 @@ static NTSTATUS open_directory(connection_struct *conn, */ mtimespec = make_omit_timespec(); - /* POSIX allows us to open a directory with O_RDONLY. */ - flags = O_RDONLY; -#ifdef O_DIRECTORY - flags |= O_DIRECTORY; -#endif - - status = reopen_from_fsp(fsp, flags, 0, NULL); + status = reopen_from_fsp(fsp, O_RDONLY|O_DIRECTORY, 0, NULL); if (!NT_STATUS_IS_OK(status)) { DBG_INFO("Could not open fd for%s (%s)\n", smb_fname_str_dbg(smb_dname), -- 2.47.2