summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@suse.com>2022-07-07 12:57:01 -0600
committerVolker Lendecke <vl@samba.org>2022-11-29 10:26:37 +0000
commitf0e1137425f5ed1ff97c729e4b39be626602e6b7 (patch)
treece54ddc11ce751c88c843bed58c3f00f8bb9848f /python
parent08226d6c2e8ed1e1d8104afcfcea37a66de0a413 (diff)
downloadsamba-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>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/smb3unix.py29
1 files changed, 29 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()