smbd: use a helper variable in open_file()
authorRalph Boehme <slow@samba.org>
Sun, 7 Jun 2020 14:42:50 +0000 (16:42 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Jul 2020 05:58:40 +0000 (05:58 +0000)
No change in behaviour, this just prepares for changes to come.

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

index a7f81a380d40faf54c6047dbe401fd02d5d9bc99..e8314fa0a3a386d572fd17f5adbbd6e2838dff88 100644 (file)
@@ -1221,6 +1221,7 @@ static NTSTATUS open_file(files_struct *fsp,
                READ_CONTROL_ACCESS;
        bool creating = !file_existed && (flags & O_CREAT);
        bool truncating = (flags & O_TRUNC);
+       bool open_fd = false;
 
        fsp->fh->fd = -1;
        errno = EPERM;
@@ -1273,6 +1274,10 @@ static NTSTATUS open_file(files_struct *fsp,
        }
 
        if ((open_access_mask & need_fd_mask) || creating || truncating) {
+               open_fd = true;
+       }
+
+       if (open_fd) {
                const char *wild;
                int ret;