]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: fix crash on systems with SELinux but without xattr support
authorPádraig Brady <P@draigBrady.com>
Thu, 20 Mar 2025 18:40:01 +0000 (18:40 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 21 Mar 2025 12:13:12 +0000 (12:13 +0000)
commitcb2abbac7f9e40e0f0d6183bf9b11e80b0cad8ef
treeadfd915473ebb52beeea74902aff5b682b5826b5
parent76b8121d62c709e3066011b094afecd3dbbb9dc4
ls: fix crash on systems with SELinux but without xattr support

This was seen on termux on Android with ./configure --disable-xattr
where listxattr() and getxattr() returned ENOTSUP.
Then the valid security context obtained by file_has_aclinfo()
was discounted, and problematically then freed multiple times.
Reported at https://github.com/termux/termux-packages/issues/23752

* src/ls.c (file_has_aclinfo_cache): Only discount the returned
acl info when all components are defaulted due to being unsupported.
NEWS
src/ls.c