From: Volker Lendecke Date: Fri, 20 Sep 2024 17:16:17 +0000 (+0200) Subject: smbd: Return reparse tag in smb311 unix query dir X-Git-Tag: tdb-1.4.13~1071 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13a9417f0da3f17ecb0d7d834e5b375649d1bcef;p=thirdparty%2Fsamba.git smbd: Return reparse tag in smb311 unix query dir Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- 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);