diff --git a/CHANGELOG.md b/CHANGELOG.md index 32376b37d183e59c2903850931c8a579751fc66d..2dc549d16b628e5f305fdea7ff68dcb9f6b52c69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.2.0 - TBD + +* Fix issue where timeout was not being applied to the new connection +* Fix various deprecated regex escape patterns + + ## 0.1.1 - 2018-09-14 * Fix initial negotiate message not setting connection timeout value diff --git a/setup.py b/setup.py index eec8526cd7932e9147d7f555f4654f7a6b4ddba9..f277e5c45baa44962d123b90651dd7e364caace4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ except ImportError: setup( name='smbprotocol', - version='0.1.1', + version='0.2.0', packages=['smbprotocol'], install_requires=[ 'cryptography>=2.0', diff --git a/smbprotocol/connection.py b/smbprotocol/connection.py index e8fe242c55e03aded0d54b6f29b4bf1ce7297ff7..5e3f62b47684ccf6d42045e707b9b27e3803fcf0 100644 --- a/smbprotocol/connection.py +++ b/smbprotocol/connection.py @@ -832,7 +832,7 @@ class Connection(object): negotiation process to complete """ log.info("Setting up transport connection") - self.transport.connect() + self.transport.connect(timeout=timeout) log.info("Starting negotiation with SMB server") smb_response = self._send_smb2_negotiate(dialect, timeout) diff --git a/smbprotocol/open.py b/smbprotocol/open.py index d47709df4335c9210323a85927993aac0323eb21..e3f1d96ecb626f1d03f9daf09bd4e1447cfde3da 100644 --- a/smbprotocol/open.py +++ b/smbprotocol/open.py @@ -883,8 +883,7 @@ class Open(object): Directory, or Printer :param tree: The Tree (share) the file is located in. - :param name: The name of the file, excluding the share path, e.g. - \\server\share\folder\file.txt would be folder\file.txt + :param name: The name of the file, excluding the share path. """ # properties available based on the file itself self._connected = False diff --git a/smbprotocol/transport.py b/smbprotocol/transport.py index 679a1de36253bf7210f1b140cb23befac668076d..ba341f09d2fda78e45cd8108a0a954cb9986ac2b 100644 --- a/smbprotocol/transport.py +++ b/smbprotocol/transport.py @@ -54,9 +54,10 @@ class Tcp(object): self._connected = False self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - def connect(self): + def connect(self, timeout=None): if not self._connected: log.info("Connecting to DirectTcp socket") + self._sock.settimeout(timeout) self._sock.connect((self.server, self.port)) self._sock.setblocking(0) self._connected = True diff --git a/smbprotocol/tree.py b/smbprotocol/tree.py index 68d4582db339347c3ed947fa4285f1d63f83d46a..1d69c9eb2e7ce9757193bc7dd0212f2383830389 100644 --- a/smbprotocol/tree.py +++ b/smbprotocol/tree.py @@ -177,9 +177,8 @@ class TreeConnect(object): 3.2.1.4 Per Tree Connect Attributes per Tree Connect (share connections) - :param session: The Session to connect to the tree with - :param share_name: The name of the share, including the server name, - e.g. \\server\share + :param session: The Session to connect to the tree with. + :param share_name: The name of the share, including the server name. """ self._connected = False self.open_table = {}