From: Volker Lendecke Date: Tue, 5 Sep 2023 12:46:21 +0000 (+0200) Subject: smbd: Simplify open_file() X-Git-Tag: tevent-0.16.0~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45005d4b71cfed06fad2f12ee17f2b8c82eb16ac;p=thirdparty%2Fsamba.git smbd: Simplify open_file() We can unconditionally just and-out O_CREAT from local_flags, so remove an if-condition. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index efcd0ceec8e..3b7236b8895 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1355,13 +1355,12 @@ static NTSTATUS open_file(struct smb_request *req, smb_fname_str_dbg(smb_fname))); return NT_STATUS_ACCESS_DENIED; } - if (flags & O_CREAT) { - /* We don't want to write - but we must make sure that - O_CREAT doesn't create the file if we have write - access into the directory. - */ - local_flags &= ~(O_CREAT|O_EXCL); - } + /* + * We don't want to write - but we must make sure that + * O_CREAT doesn't create the file if we have write + * access into the directory. + */ + local_flags &= ~(O_CREAT | O_EXCL); } /*