mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
ls: fix crash with --context
* src/ls.c (main): Flag that we need to stat() if we're going to get security context (call file_has_aclinfo_cache). (file_has_aclinfo_cache): Be defensive and only lookup the device for the file if the stat has been performed. (has_capability_cache): Likewise. * tests/ls/selinux-segfault.sh: Add a test case. * NEWS: Mention the bug fix. Reported by Bruno Haible.
This commit is contained in:
@@ -30,4 +30,7 @@ mkdir sedir || framework_failure_
|
||||
ln -sf missing sedir/broken || framework_failure_
|
||||
returns_ 1 ls -L -R -Z -m sedir > out || fail=1
|
||||
|
||||
# ls 9.6 would segfault with the following
|
||||
ls -Z . > out || fail=1
|
||||
|
||||
Exit $fail
|
||||
|
||||
Reference in New Issue
Block a user