From: Ralph Boehme Date: Sun, 7 Jun 2020 14:42:50 +0000 (+0200) Subject: smbd: use a helper variable in open_file() X-Git-Tag: talloc-2.3.2~1072 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab75d2c629969f1b654c7228eb7fb050eeb615d;p=thirdparty%2Fsamba.git smbd: use a helper variable in open_file() No change in behaviour, this just prepares for changes to come. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a7f81a380d4..e8314fa0a3a 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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;