1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

tests: Add reproducer for bug 15487

Show that smbd crashes if asked to return full information on close of a
stream handle with delete on close disposition set.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15487

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-10-07 12:28:05 +02:00
parent 340f0420bd
commit 23deb79a28
2 changed files with 22 additions and 0 deletions

View File

@ -242,6 +242,27 @@ class LibsmbTestCase(samba.tests.libsmb.LibsmbTests):
# Without the bugfix for 15481 we get 'file' not 'File'
self.assertEqual(directory[0]['name'], 'File')
def test_stream_close_with_full_information(self):
c = libsmb.Conn(self.server_ip, "streams_xattr", self.lp, self.creds)
try:
c.deltree("teststreams")
except:
pass
c.mkdir("teststreams")
fh = c.create("teststreams\\stream_full_close_info.txt:Stream",
DesiredAccess=security.SEC_STD_DELETE,
CreateDisposition=libsmb.FILE_CREATE)
c.delete_on_close(fh, 1)
try:
c.close(fh, libsmb.SMB2_CLOSE_FLAGS_FULL_INFORMATION)
except:
self.fail()
c.deltree("teststreams")
if __name__ == "__main__":
import unittest
unittest.main()

View File

@ -0,0 +1 @@
^samba.tests.libsmb-basic.samba.tests.libsmb-basic.LibsmbTestCase.test_stream_close_with_full_information