smbd: Return reparse tag as of MS-FSCC 2.4.6
authorVolker Lendecke <vl@samba.org>
Wed, 8 May 2024 14:03:29 +0000 (16:03 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 14 May 2024 22:29:36 +0000 (22:29 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/reparse
source3/smbd/smb2_trans2.c

index 7cc4cab75695e2fa55e2c8ded2bb0b943b17f27b..11d094aa5c698580b2c4be996fbc38800cd8ef66 100644 (file)
@@ -1,3 +1,2 @@
 ^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_create_reparse_directory
 ^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_create_reparse_nonempty_directory
-^samba.tests.reparsepoints.samba.tests.reparsepoints.ReparsePoints.test_query_reparse_tag
index fe1af381226727188c7007b1dde69e2e83f52432..09cd7594465222d60aa9f2531c51a1ebd211cdfa 100644 (file)
@@ -48,6 +48,7 @@
 #include "source3/lib/substitute.h"
 #include "source3/lib/adouble.h"
 #include "source3/smbd/dir.h"
+#include "source3/modules/util_reparse.h"
 
 #define DIR_ENTRY_SAFETY_MARGIN 4096
 
@@ -3676,14 +3677,27 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                        *fixed_portion = 56;
                        break;
 
-               case SMB_FILE_ATTRIBUTE_TAG_INFORMATION:
+               case SMB_FILE_ATTRIBUTE_TAG_INFORMATION: {
+                       uint32_t tag = 0;
+                       uint8_t *data = NULL;
+                       uint32_t datalen;
+
                        DBG_DEBUG("SMB_FILE_ATTRIBUTE_TAG_INFORMATION\n");
-                       SIVAL(pdata,0,mode);
-                       SIVAL(pdata,4,0);
+
+                       (void)fsctl_get_reparse_point(fsp,
+                                                     talloc_tos(),
+                                                     &tag,
+                                                     &data,
+                                                     UINT32_MAX,
+                                                     &datalen);
+                       TALLOC_FREE(data);
+
+                       SIVAL(pdata, 0, mode);
+                       SIVAL(pdata, 4, tag);
                        data_size = 8;
                        *fixed_portion = 8;
                        break;
-
+               }
                /*
                 * SMB2 UNIX Extensions.
                 */