From: Volker Lendecke Date: Tue, 14 Jun 2022 15:21:54 +0000 (+0200) Subject: smbd: Simplify openat_pathref_fullname() X-Git-Tag: tevent-0.13.0~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52ecf98688d7ba3ce6a203791df6a21d654fd1b5;p=thirdparty%2Fsamba.git smbd: Simplify openat_pathref_fullname() Don't set O_RDONLY|O_NONBLOCK in two steps into a variable Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index ea0fe39330c..84ac80851f4 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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;