summaryrefslogtreecommitdiff
path: root/tests/smbserver.py
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2021-11-01 12:06:07 +0100
committerMarc Hoersken <info@marc-hoersken.de>2021-11-01 20:50:35 +0100
commitd52316e460136634e83fa847de45d6f16df44cfe (patch)
tree7e031a3310a723ce5caf0da202053b75f0ff01c2 /tests/smbserver.py
parent92efb3db7e172946a467d6303f982f282c1d001f (diff)
downloadcurl-d52316e460136634e83fa847de45d6f16df44cfe.tar.gz
tests/smbserver.py: fix compatibility with impacket 0.9.23+
impacket now performs sanity checks if the requested and to be served file path actually is inside the real share path. Ref: https://github.com/SecureAuthCorp/impacket/pull/1066 Fixes #7924 Closes #7935
Diffstat (limited to 'tests/smbserver.py')
-rwxr-xr-xtests/smbserver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/smbserver.py b/tests/smbserver.py
index 3040175c0..3c4b96ed2 100755
--- a/tests/smbserver.py
+++ b/tests/smbserver.py
@@ -21,8 +21,8 @@
#
"""Server for testing SMB"""
-from __future__ import absolute_import, division, print_function
-# NOTE: the impacket configuration is not unicode_literals compatible!
+from __future__ import (absolute_import, division, print_function,
+ unicode_literals)
import argparse
import logging
@@ -201,7 +201,8 @@ class TestSmbServer(imp_smbserver.SMBSERVER):
# Get this file's information
resp_info, error_code = imp_smbserver.queryPathInformation(
- "", full_path, level=imp_smb.SMB_QUERY_FILE_ALL_INFO)
+ os.path.dirname(full_path), os.path.basename(full_path),
+ level=imp_smb.SMB_QUERY_FILE_ALL_INFO)
if error_code != STATUS_SUCCESS:
raise SmbException(error_code, "Failed to query path info")