]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: Codify IO_REPARSE_TAG_MISMATCH behaviour
authorVolker Lendecke <vl@samba.org>
Fri, 3 May 2024 12:49:46 +0000 (14:49 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 6 May 2024 20:55:37 +0000 (20:55 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/tests/reparsepoints.py

index 8644e31c3593f652d3e327f2c03b2d9601153dd7..76bfb6a733abac268f295ba35440cbe767d6514a 100644 (file)
@@ -107,8 +107,14 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
 
         # Exact length works
         conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
-        b = reparse_symlink.put(0x80000026, 0, b'asdfasdfasdfasdfasdfasdf')
-        conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
+
+        b = reparse_symlink.put(0x80000026, 0, b'asdf')
+
+        # We can't overwrite an existing reparse point with a different tag
+        with self.assertRaises(NTSTATUSError) as e:
+            conn.fsctl(fd, libsmb.FSCTL_SET_REPARSE_POINT, b, 0)
+        self.assertEqual(e.exception.args[0],
+                         ntstatus.NT_STATUS_IO_REPARSE_TAG_MISMATCH)
 
     # Show that we can write to a reparse point when opened properly
     def test_write_reparse(self):