summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsrijan-sivakumar <ssivakum@redhat.com>2020-09-16 08:55:22 +0530
committersrijan-sivakumar <ssivakum@redhat.com>2020-09-16 09:01:53 +0530
commit5348292bf0fd79035b5817915922133cee8eb785 (patch)
tree284a92bd21278f1dd6f942b57e740c669b64b192
parenta699974a698fdc15a5015dfe53b92055dc74dadd (diff)
quota_fsck.py fails with UnicodeDecodeError
Issue: While decoding the byte characters the quota_fsck script stumbled across a corner case wherein the file names given by the getfattr dump will cause the decoding to UTF-8 to fail with UnicodeDecodeError. Code Change: On looking through the quota_fsck.py script, it seems like the file path is actually not needed when decoding for the xattr parsing, hence the code change reflects that. Also, removed a comparison which previously existed to skip the file names as that won't be required now. Fixes: #1487 Change-Id: I8a13ab07be6c9cfafae996f17764fbb4a285bd8c Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
-rwxr-xr-xextras/quota/quota_fsck.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/extras/quota/quota_fsck.py b/extras/quota/quota_fsck.py
index ea8d638112b..e62f7fc52a3 100755
--- a/extras/quota/quota_fsck.py
+++ b/extras/quota/quota_fsck.py
@@ -156,13 +156,10 @@ def get_quota_xattr_brick(dpath):
xattr_dict = {}
xattr_dict['parents'] = {}
- for xattr in pairs:
+ for xattr in pairs[1:]:
xattr = xattr.decode("utf-8")
xattr_key = xattr.split("=")[0]
- if re.search("# file:", xattr_key):
- # skip the file comment
- continue
- elif xattr_key is "":
+ if xattr_key == "":
# skip any empty lines
continue
elif not re.search("quota", xattr_key):