From: Volker Lendecke Date: Fri, 3 May 2024 12:49:46 +0000 (+0200) Subject: tests: Codify IO_REPARSE_TAG_MISMATCH behaviour X-Git-Tag: tdb-1.4.11~867 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4536cfb1ec1fdf7dcaf0989d04770512c208e241;p=thirdparty%2Fsamba.git tests: Codify IO_REPARSE_TAG_MISMATCH behaviour Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/python/samba/tests/reparsepoints.py b/python/samba/tests/reparsepoints.py index 8644e31c359..76bfb6a733a 100644 --- a/python/samba/tests/reparsepoints.py +++ b/python/samba/tests/reparsepoints.py @@ -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):