From b311f4eca3b6da65ef9527597cab5965bb6c683c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Jul 2024 17:31:19 +0200 Subject: [PATCH] smbd: Turn an if-statement getting reparse points into a switch There will be more cases soon Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/modules/util_reparse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/modules/util_reparse.c b/source3/modules/util_reparse.c index fce3603e780..5c7ae670d0b 100644 --- a/source3/modules/util_reparse.c +++ b/source3/modules/util_reparse.c @@ -93,10 +93,14 @@ NTSTATUS fsctl_get_reparse_point(struct files_struct *fsp, return NT_STATUS_NOT_A_REPARSE_POINT; } - if (S_ISREG(fsp->fsp_name->st.st_ex_mode)) { + switch (fsp->fsp_name->st.st_ex_mode & S_IFMT) { + case S_IFREG: DBG_DEBUG("%s is a regular file\n", fsp_str_dbg(fsp)); status = fsctl_get_reparse_point_reg( fsp, mem_ctx, &out_data, max_out_len, &out_len); + break; + default: + break; } if (!NT_STATUS_IS_OK(status)) { -- 2.47.3