]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: fix crash printing SELinux context for unstatable files
authorPádraig Brady <P@draigBrady.com>
Wed, 11 Nov 2020 17:22:33 +0000 (17:22 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 11 Nov 2020 17:28:54 +0000 (17:28 +0000)
commit6fc695cb4a26f09dfeef8b1c24895a707055334e
tree78a06532e3b40d2ccf96d66b73d2aa7aaa5d58f0
parentbeafa5c0a303ce51e62963f6fafb9096ac59cac1
ls: fix crash printing SELinux context for unstatable files

This crash was identified by Cyber Independent Testing Lab:
https://cyber-itl.org/2020/10/28/citl-7000-defects.html
and was introduced with commit v6.9.90-11-g4245876e2

* src/ls.c (gobble_file): Ensure scontext is initialized
in the case where files are not statable.
* tests/ls/selinux-segfault.sh: Renamed from proc-selinux-segfault.sh,
and added test case for broken symlinks.
* tests/local.mk: Adjust for the renamed test.
* NEWS: Mention the bug fix.
NEWS
src/ls.c
tests/local.mk
tests/ls/selinux-segfault.sh [moved from tests/ls/proc-selinux-segfault.sh with 77% similarity]