From 8cf603f12052bdc867f2a9551504451610892f72 Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Fri, 31 May 2024 19:54:39 +0200 Subject: [PATCH] Fixed display bug in utils.windows_ls_entry() --- smbclientng/core/InteractiveShell.py | 2 +- smbclientng/core/utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/smbclientng/core/InteractiveShell.py b/smbclientng/core/InteractiveShell.py index 92efe18..cbb4985 100644 --- a/smbclientng/core/InteractiveShell.py +++ b/smbclientng/core/InteractiveShell.py @@ -441,7 +441,7 @@ def command_ls(self, arguments, command): directory_contents = self.smbSession.list_contents(path=' '.join(arguments)) for longname in sorted(directory_contents.keys(), key=lambda x:x.lower()): - windows_ls_entry(directory_contents[longname]) + windows_ls_entry(directory_contents[longname], self.config) @command_arguments_required @active_smb_connection_needed diff --git a/smbclientng/core/utils.py b/smbclientng/core/utils.py index 8b46f9c..1a93a0c 100644 --- a/smbclientng/core/utils.py +++ b/smbclientng/core/utils.py @@ -148,8 +148,10 @@ def windows_ls_entry(entry, config, pathToPrint=None): str: A string representing the metadata of the entry, including attributes like directory, archive, compressed, hidden, normal, readonly, system, and temporary. """ - if pathToPrint is None: - pathToPrint = entry + if pathToPrint is not None: + pathToPrint = pathToPrint + ntpath.sep + entry.get_longname() + else: + pathToPrint = entry.get_longname() meta_string = "" meta_string += ("d" if entry.is_directory() else "-")