]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Return reparse tag in smb311 unix query dir
authorVolker Lendecke <vl@samba.org>
Fri, 20 Sep 2024 17:16:17 +0000 (19:16 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2024 15:22:46 +0000 (15:22 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb2_trans2.c

index 26b9a9123c323ff46e7c5fd6d770f046225fa532..e8af2bef08f45ab0dcbc9b85c87d9b3a2e02fb09 100644 (file)
@@ -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);