]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: open_directory(). Cleanup. We don't need 'int flags' here.
authorJeremy Allison <jra@samba.org>
Wed, 9 Jun 2021 19:01:03 +0000 (12:01 -0700)
committerRalph Boehme <slow@samba.org>
Fri, 18 Jun 2021 16:32:28 +0000 (16:32 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index 3e48a9f35de67b7891a76a21e6fbf4fe7cc9ad16..daedb4a2c078e32033667a67ccfcdcd06d3346e4 100644 (file)
@@ -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),