Skip to content

Handle errors during xattr copy in a more robust way

Stefan Brüns requested to merge bruns/kio:fix_kio_file_xattr into master

Always break/return the loop if the error case is not handled explicitly.

This fixes an issue in the attribute reading loop. Some SELINUX attributes outside the "user." namespace can be listed, but not be read and fgetxattr sets errno = ENOTSUP (while not mentioned for fgetxattr, the case is specified for fsetxattr).

In case one attribute fails to read, continue with next one, to preserve as much as possible.

Also break the outer loop in case we run out of space.

Merge request reports