From 13a9417f0da3f17ecb0d7d834e5b375649d1bcef Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 20 Sep 2024 19:16:17 +0200 Subject: [PATCH] smbd: Return reparse tag in smb311 unix query dir Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/smbd/smb2_trans2.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 26b9a9123c3..e8af2bef08f 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -1746,6 +1746,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, .fixed_buf_size = true, }; enum ndr_err_code ndr_err; + uint32_t tag = 0; DBG_DEBUG("SMB2_FILE_POSIX_INFORMATION\n"); @@ -1756,8 +1757,20 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, return NT_STATUS_INVALID_LEVEL; } + if (mode & FILE_ATTRIBUTE_REPARSE_POINT) { + status = fsctl_get_reparse_tag(smb_fname->fsp, + &tag); + if (!NT_STATUS_IS_OK(status)) { + DBG_DEBUG("Could not get reparse " + "tag for %s: %s\n", + smb_fname_str_dbg(smb_fname), + nt_errstr(status)); + return status; + } + } + smb3_file_posix_information_init( - conn, &smb_fname->st, 0, mode, &info); + conn, &smb_fname->st, tag, mode, &info); ndr_err = ndr_push_smb3_file_posix_information( &ndr, NDR_SCALARS|NDR_BUFFERS, &info); -- 2.47.3