]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: simplify non_widelink_open()
authorRalph Boehme <slow@samba.org>
Tue, 17 Mar 2020 16:35:44 +0000 (17:35 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 24 Mar 2020 19:48:41 +0000 (19:48 +0000)
As fsp->is_directory is already correctly populated by our callers, we can drop
the complicated and possibly broken logic that relies on O_DIRECTORY being
defined.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 6e65ff8d53d4b3e827bbb02a11d29e01a1beb6d4..378c43272ab6147404f989d3943bf2434ecf358a 100644 (file)
@@ -612,16 +612,9 @@ static int non_widelink_open(struct connection_struct *conn,
        char *parent_dir = NULL;
        struct smb_filename parent_dir_fname = {0};
        const char *final_component = NULL;
-       bool is_directory = false;
        bool ok;
 
-#ifdef O_DIRECTORY
-       if (flags & O_DIRECTORY) {
-               is_directory = true;
-       }
-#endif
-
-       if (is_directory) {
+       if (fsp->is_directory) {
                parent_dir = talloc_strdup(talloc_tos(), smb_fname->base_name);
                if (parent_dir == NULL) {
                        saved_errno = errno;