tag potentially smeared dentry names

This commit is contained in:
Abyss Watcher
2025-05-06 00:31:09 +02:00
parent 140a16d1dd
commit 2759df89db
@@ -169,6 +169,7 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface):
return ""
path_reversed = []
smeared = False
while (
dentry
and dentry.is_readable()
@@ -190,14 +191,16 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface):
parent = dentry.d_parent
dname = dentry.d_name.name_as_str()
dname_stripped = dname.strip("/")
if dname_stripped:
path_reversed.append(dname_stripped)
# empty dentry names are most likely
# the result of smearing
if not dname:
smeared = True
path_reversed.append(dname.strip("/"))
dentry = parent
if path_reversed == []:
return ""
path = "/" + "/".join(reversed(path_reversed))
if smeared:
return f"<potentially smeared> {path}"
return path
@classmethod