Skip to content

Commit

Permalink
Update SMBSession.py to fix #3
Browse files Browse the repository at this point in the history
Fix #3
  • Loading branch information
Hackndo authored Jun 3, 2024
1 parent e721a5b commit b55f9d9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions smbclientng/core/SMBSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,11 @@ def list_contents(self, path=None):
dict: A dictionary with file and directory names as keys and their SMB entry objects as values.
"""

if path is None or len(path) == 0:
path = self.smb_cwd
path = path.rstrip(ntpath.sep) + ntpath.sep + "*"
dest_path = [self.smb_cwd.rstrip(ntpath.sep),]
if path is not None and len(path) > 0:
dest_path.append(path.rstrip(ntpath.sep))
dest_path.append('*')
path = ntpath.sep.join(dest_path)

contents = {}
entries = self.smbClient.listPath(
Expand Down

0 comments on commit b55f9d9

Please sign in to comment.