From: Anoop C S Date: Thu, 11 Sep 2025 06:11:25 +0000 (+0530) Subject: smbd: Fix CID 1665417, UNUSED_VALUE in openat_pathref_fsp_dot() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ec54347acac241f900b52c16c2dcba04164e898;p=thirdparty%2Fsamba.git smbd: Fix CID 1665417, UNUSED_VALUE in openat_pathref_fsp_dot() Rearrange how the open flags are defined so as to make Coverity happy about it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15897 Signed-off-by: Anoop C S Reviewed-by: Volker Lendecke Autobuild-User(master): Anoop C S Autobuild-Date(master): Mon Sep 15 15:44:38 UTC 2025 on atb-devel-224 --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 3cf1e78a704..334810e45f9 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -1672,9 +1672,7 @@ NTSTATUS openat_pathref_fsp_dot(TALLOC_CTX *mem_ctx, struct connection_struct *conn = dirfsp->conn; struct files_struct *fsp = NULL; struct smb_filename *full_fname = NULL; - struct vfs_open_how how = { - .flags = O_RDONLY | O_NONBLOCK | O_NOFOLLOW, - }; + struct vfs_open_how how = { .flags = O_NOFOLLOW, }; struct smb_filename *dot = NULL; NTSTATUS status; int fd; @@ -1684,7 +1682,9 @@ NTSTATUS openat_pathref_fsp_dot(TALLOC_CTX *mem_ctx, #endif #ifdef O_PATH - how.flags = O_PATH; + how.flags |= O_PATH; +#else + how.flags |= (O_RDONLY | O_NONBLOCK); #endif dot = synthetic_smb_fname(mem_ctx, ".", NULL, NULL, 0, flags);