Skip to content

Commit

Permalink
tests: Add reproducer for bug 15487
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
vlendec committed Oct 10, 2023
1 parent 340f042 commit 23deb79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/samba/tests/libsmb-basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,27 @@ def test_gencache_pollution_bz15481(self):
# 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()
1 change: 1 addition & 0 deletions selftest/knownfail.d/close_full_info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^samba.tests.libsmb-basic.samba.tests.libsmb-basic.LibsmbTestCase.test_stream_close_with_full_information

0 comments on commit 23deb79

Please sign in to comment.