From: Ralph Boehme Date: Sun, 25 May 2025 13:15:27 +0000 (+0200) Subject: tests: expand SMB3 POSIX test for Windows illegal characters behaviour X-Git-Tag: tdb-1.4.14~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93ad870a1e497066f82e8ec85c8a643dcd15b4de;p=thirdparty%2Fsamba.git tests: expand SMB3 POSIX test for Windows illegal characters behaviour The test was testing file creation, but not FIND behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15862 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/python/samba/tests/smb3unix.py b/python/samba/tests/smb3unix.py index 5c8ab182061..289bc5ac5b4 100644 --- a/python/samba/tests/smb3unix.py +++ b/python/samba/tests/smb3unix.py @@ -182,13 +182,30 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests): wire_mode = libsmb.unix_mode_to_wire(0o744) f,_,cc_out = c.create_ex('\\%s' % fname, CreateDisposition=libsmb.FILE_CREATE, - DesiredAccess=security.SEC_STD_DELETE, + DesiredAccess=security.SEC_FILE_READ_ATTRIBUTE, CreateContexts=[posix_context(wire_mode)]) except NTSTATUSError as e: self.fail(e) - c.delete_on_close(f, True) c.close(f) + try: + res = c.list('', info_level=libsmb.SMB2_FIND_POSIX_INFORMATION) + found_files = {get_string(i['name']): i for i in res} + for fname in test_files: + self.assertTrue(fname in found_files) + except NTSTATUSError as e: + self.fail(e) + finally: + wire_mode = libsmb.unix_mode_to_wire(0o600) + for fname in test_files: + f,_,_ = c.create_ex('\\%s' % fname, + CreateDisposition=libsmb.FILE_OPEN, + DesiredAccess=security.SEC_STD_DELETE, + CreateContexts=[posix_context(wire_mode)]) + c.delete_on_close(f, True) + c.close(f) + + def test_posix_delete_on_close(self): c = libsmb.Conn( self.server_ip, diff --git a/selftest/knownfail.d/samba.tests.smb3unix b/selftest/knownfail.d/samba.tests.smb3unix new file mode 100644 index 00000000000..4e3f64a863f --- /dev/null +++ b/selftest/knownfail.d/samba.tests.smb3unix @@ -0,0 +1 @@ +^samba.tests.smb3unix.*test_posix_reserved_char\(fileserver_smb1\)