Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More advanced DFS compatibility checks #253

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* This avoid having to call `stat()` to retrieve data like the file attributes or datetime fields that is already available
* Ensure `DateTimeField` values are set to `UTC` timezones as FILETIME values are in UTC
* Stop using `datetime.datetime.utcfromtimestamp()` as it has been deprecated
* Avoid setting DFS request when the server does not report it is capable of DFS operations.

## 1.12.0 - 2023-11-09

Expand Down
2 changes: 1 addition & 1 deletion src/smbprotocol/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@
if tree_id not in session.tree_connect_table:
raise SMBException("Cannot find Tree with the ID %d in the session tree table" % tree_id)
tree = session.tree_connect_table[tree_id]
is_dfs = tree.is_dfs_share
is_dfs = self.server_capabilities.has_flag(Capabilities.SMB2_GLOBAL_CAP_DFS) and tree.is_dfs_share

Check warning on line 1201 in src/smbprotocol/connection.py

View check run for this annotation

Codecov / codecov/patch

src/smbprotocol/connection.py#L1201

Added line #L1201 was not covered by tests

total_requests = len(messages)
for i, message in enumerate(messages):
Expand Down