Skip to content

Commit

Permalink
Merge pull request #57 from p0dalirius/improve-module-find-output-format
Browse files Browse the repository at this point in the history
[bugfix] Fixed double backslashes in paths printed by module find
  • Loading branch information
p0dalirius authored Jun 22, 2024
2 parents 7f91439 + 45db71d commit a01f869
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions smbclientng/core/SMBSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,13 @@ def recurse_action(paths=[], depth=0, callback=None):

for entry in entries:
if entry.is_directory():
callback(entry, path + ntpath.sep + entry.get_longname() + ntpath.sep, depth)
fullpath = path + ntpath.sep + entry.get_longname() + ntpath.sep
next_directories_to_explore.append(fullpath)
else:
callback(entry, path + ntpath.sep + entry.get_longname(), depth)

# Next directories to explore
for entry in entries:
if entry.is_directory():
next_directories_to_explore.append(path + ntpath.sep + entry.get_longname() + ntpath.sep)

fullpath = path + ntpath.sep + entry.get_longname()
fullpath = re.sub(r'\\\\+', r'\\', fullpath)
callback(entry, fullpath, depth)

return next_directories_to_explore
#
if callback is not None:
Expand Down

0 comments on commit a01f869

Please sign in to comment.