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.
cache for the whole file. Previously it may have erroneously succeeded.
[bug introduced with the "nocache" feature in coreutils-8.11]
- 'ls -Z dir' would crash.
+ 'ls -Z dir' would crash on all systems, and 'ls -l' could crash
+ on systems like Android with SELinux but without xattr support.
[bug introduced in coreutils-9.6]
'who -m' now outputs entries for remote logins. Previously login
errno = 0;
int n = file_has_aclinfo (file, ai, flags);
int err = errno;
- if (f->stat_ok && n <= 0 && !acl_errno_valid (err))
+ if (f->stat_ok && n <= 0 && !acl_errno_valid (err)
+ && (!(flags & ACL_GET_SCONTEXT) || !acl_errno_valid (ai->scontext_err)))
{
unsupported_return = n;
unsupported_scontext = ai->scontext;