diff --git a/python/samba/tests/smb2symlink.py b/python/samba/tests/smb2symlink.py index 32d2f94b37e..a2084c6a5de 100644 --- a/python/samba/tests/smb2symlink.py +++ b/python/samba/tests/smb2symlink.py @@ -177,6 +177,21 @@ class Smb2SymlinkTests(samba.tests.libsmb.LibsmbTests): self.clean_file(smb1, symlink) + def test_symlink_reparse_data_buffer_parse(self): + """Test parsing a symlink reparse buffer coming from Windows""" + + buf = (b'\x0c\x00\x00\xa0\x18\x00\x00\x00' + b'\x06\x00\x06\x00\x00\x00\x06\x00' + b'\x01\x00\x00\x00\x62\x00\x61\x00' + b'\x72\x00\x62\x00\x61\x00\x72\x00') + + try: + syml = reparse_symlink.symlink_get(buf); + except: + self.fail("Could not parse symlink buffer") + + self.assertEqual(syml, ('bar', 'bar', 0, 1)); + if __name__ == '__main__': import unittest unittest.main() diff --git a/selftest/knownfail.d/symlink b/selftest/knownfail.d/symlink index 64135666aec..ade7b9e70c6 100644 --- a/selftest/knownfail.d/symlink +++ b/selftest/knownfail.d/symlink @@ -2,3 +2,4 @@ ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_file ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_absolute_outside_share ^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlinkerror_absolute_inshare +^samba.tests.smb2symlink.samba.tests.smb2symlink.Smb2SymlinkTests.test_symlink_reparse_data_buffer_parse