diff --git a/changelogs/fragments/3675-xattr-handle-base64-values.yml b/changelogs/fragments/3675-xattr-handle-base64-values.yml new file mode 100644 index 0000000000..e74a2afedd --- /dev/null +++ b/changelogs/fragments/3675-xattr-handle-base64-values.yml @@ -0,0 +1,3 @@ +bugfixes: + - xattr - fix exception caused by ``_run_xattr()`` raising a ``ValueError`` + due to a mishandling of base64-encoded value (https://github.com/ansible-collections/community.general/issues/3673). diff --git a/plugins/modules/files/xattr.py b/plugins/modules/files/xattr.py index f862dd720b..21d71170d1 100644 --- a/plugins/modules/files/xattr.py +++ b/plugins/modules/files/xattr.py @@ -158,7 +158,7 @@ def _run_xattr(module, cmd, check_rc=True): if line.startswith('#') or line == '': pass elif '=' in line: - (key, val) = line.split('=') + (key, val) = line.split('=', 1) result[key] = val.strip('"') else: result[line] = ''