[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Jun 4 17:40:01 UTC 2024


The branch, master has been updated
       via  c005de07aee smbd: list reparse tag in QUERY_DIRECTORY
       via  1dba6d3cfc5 tests: Check that query_directory lists the reparse tag
      from  747a7fec01d s3:rpc_server: Check query level according to MS-NRPC

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c005de07aee30307c9d584130ec825bd7097961b
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jan 2 16:35:16 2023 +0100

    smbd: list reparse tag in QUERY_DIRECTORY
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jun  4 17:39:21 UTC 2024 on atb-devel-224

commit 1dba6d3cfc53931d3c8968e12e0d9cde272824be
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jan 2 16:01:28 2023 +0100

    tests: Check that query_directory lists the reparse tag
    
    With the source3/ based clilist.c, we can't test all infolevels where
    this matters (see callers of get_dirent_ea_size()). But porting the
    source4 based all-infolevel search code into source3/libsmb or doing
    this one the reparse point test in the source4 infrastructure to me
    seems like a lot of effort for moderate gain.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/tests/reparsepoints.py | 20 ++++++++++++++++++++
 source3/smbd/smb2_trans2.c          | 12 ++++++++----
 2 files changed, 28 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/reparsepoints.py b/python/samba/tests/reparsepoints.py
index 1f74c61bc64..bf96def422d 100644
--- a/python/samba/tests/reparsepoints.py
+++ b/python/samba/tests/reparsepoints.py
@@ -170,6 +170,26 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
         conn.delete_on_close(fd, 1)
         conn.close(fd)
 
+    def test_query_dir_reparse(self):
+        conn = self.connection()
+        filename = 'reparse'
+        self.clean_file(conn, filename)
+
+        fd = conn.create(
+            filename,
+            DesiredAccess=sec.SEC_FILE_WRITE_ATTRIBUTE,
+            CreateDisposition=libsmb.FILE_CREATE)
+        b = reparse_symlink.symlink_put("y", "y", 0, 0)
+        conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
+        conn.close(fd)
+
+        dirents = conn.list("", filename)
+        self.assertEqual(
+            dirents[0]["reparse_tag"],
+            libsmb.IO_REPARSE_TAG_SYMLINK)
+
+        self.clean_file(conn, filename)
+
     # Show that directories can carry reparse points
 
     def test_create_reparse_directory(self):
diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c
index 3c44a97d74c..65940295248 100644
--- a/source3/smbd/smb2_trans2.c
+++ b/source3/smbd/smb2_trans2.c
@@ -1064,11 +1064,15 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx,
 
 static uint32_t get_dirent_ea_size(uint32_t mode, files_struct *fsp)
 {
-	if (!(mode & FILE_ATTRIBUTE_REPARSE_POINT)) {
-		unsigned ea_size = estimate_ea_size(fsp);
-		return ea_size;
+	uint32_t ea_size = IO_REPARSE_TAG_DFS;
+
+	if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+		(void)fsctl_get_reparse_tag(fsp, &ea_size);
+	} else {
+		ea_size = estimate_ea_size(fsp);
 	}
-	return IO_REPARSE_TAG_DFS;
+
+	return ea_size;
 }
 
 static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list