smbd: Simplify openat_pathref_fullname()
authorVolker Lendecke <vl@samba.org>
Tue, 14 Jun 2022 15:21:54 +0000 (17:21 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Jul 2022 12:04:33 +0000 (12:04 +0000)
Don't set O_RDONLY|O_NONBLOCK in two steps into a variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/files.c

index ea0fe39330c1f81007eb92918cb5b9ca2a07eb75..84ac80851f4c1ef266e03d69a3008c63f9628d90 100644 (file)
@@ -447,7 +447,6 @@ static NTSTATUS openat_pathref_fullname(
 {
        struct connection_struct *conn = dirfsp->conn;
        struct files_struct *fsp = NULL;
-       int open_flags = O_RDONLY;
        NTSTATUS status;
 
        DBG_DEBUG("smb_fname [%s]\n", smb_fname_str_dbg(smb_fname));
@@ -470,9 +469,8 @@ static NTSTATUS openat_pathref_fullname(
                goto fail;
        }
 
-       open_flags |= O_NONBLOCK;
-
-       status = fd_openat(dirfsp, smb_fname, fsp, open_flags, 0);
+       status = fd_openat(
+               dirfsp, smb_fname, fsp, O_RDONLY|O_NONBLOCK, 0);
        if (!NT_STATUS_IS_OK(status)) {
 
                smb_fname->st = fsp->fsp_name->st;