Skip to content

Commit f887f48

Browse files
authored
Changes to prevent raising IOError if xattr cannot read attributes (#743)
1 parent 906a93c commit f887f48

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

config/dpkg/changelog

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dfvfs (20230527-1) unstable; urgency=low
1+
dfvfs (20230531-1) unstable; urgency=low
22

33
* Auto-generated
44

5-
-- Log2Timeline maintainers <[email protected]> Sat, 27 May 2023 08:06:14 +0200
5+
-- Log2Timeline maintainers <[email protected]> Wed, 31 May 2023 18:17:37 +0200

dfvfs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
storage media types and file formats.
77
"""
88

9-
__version__ = '20230527'
9+
__version__ = '20230531'

dfvfs/vfs/os_file_entry.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,21 @@ def _GetAttributes(self):
108108
self._attributes = []
109109

110110
if xattr:
111-
for name in xattr.listxattr(self._location):
111+
try:
112+
attribute_names = list(xattr.listxattr(self._location))
113+
except IOError:
114+
attribute_names = []
115+
116+
for name in attribute_names:
112117
if isinstance(name, bytes):
113118
name = os.fsdecode(name)
114119

115-
extended_attribute = os_attribute.OSExtendedAttribute(
116-
self._location, name)
117-
self._attributes.append(extended_attribute)
120+
try:
121+
extended_attribute = os_attribute.OSExtendedAttribute(
122+
self._location, name)
123+
self._attributes.append(extended_attribute)
124+
except IOError:
125+
pass
118126

119127
return self._attributes
120128

0 commit comments

Comments
 (0)