diff options
author | David Mulder <dmulder@suse.com> | 2022-07-07 12:57:01 -0600 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2022-11-29 10:26:37 +0000 |
commit | f0e1137425f5ed1ff97c729e4b39be626602e6b7 (patch) | |
tree | ce54ddc11ce751c88c843bed58c3f00f8bb9848f | |
parent | 08226d6c2e8ed1e1d8104afcfcea37a66de0a413 (diff) | |
download | samba-f0e1137425f5ed1ff97c729e4b39be626602e6b7.tar.gz |
tests/s3: Test reserved chars in posix filename
Disabled because we don't handle posix paths
correctly yet.
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | python/samba/tests/smb3unix.py | 29 | ||||
-rw-r--r-- | selftest/knownfail.d/smb3unix | 1 |
2 files changed, 30 insertions, 0 deletions
diff --git a/python/samba/tests/smb3unix.py b/python/samba/tests/smb3unix.py index a667fcaaed1..8a988bf15a5 100644 --- a/python/samba/tests/smb3unix.py +++ b/python/samba/tests/smb3unix.py @@ -192,3 +192,32 @@ class Smb3UnixTests(samba.tests.libsmb.LibsmbTests): self.delete_test_file(c, fname) self.disable_smb3unix() + + def test_posix_reserved_char(self): + try: + self.enable_smb3unix() + + c = libsmb.Conn( + self.server_ip, + "smb3_posix_share", + self.lp, + self.creds, + posix=True) + self.assertTrue(c.have_posix()) + + test_files = ['a ', 'a ', '. ', '. ', 'a.', + '.a', ' \\ ', '>', '<' '?'] + + for fname in test_files: + try: + f,_,cc_out = c.create_ex('\\%s' % fname, + CreateDisposition=libsmb.FILE_CREATE, + DesiredAccess=security.SEC_STD_DELETE, + CreateContexts=[posix_context(0o744)]) + except NTSTATUSError as e: + self.fail(e) + c.delete_on_close(f, True) + c.close(f) + + finally: + self.disable_smb3unix() diff --git a/selftest/knownfail.d/smb3unix b/selftest/knownfail.d/smb3unix new file mode 100644 index 00000000000..fc3e90daf55 --- /dev/null +++ b/selftest/knownfail.d/smb3unix @@ -0,0 +1 @@ +^samba.tests.smb3unix.samba.tests.smb3unix.Smb3UnixTests.test_posix_reserved_char\(fileserver\) |