[LTP] [PATCH v3 2/2] Add listxattr04 reproducer
Andrea Cervesato
andrea.cervesato@suse.com
Wed Jul 16 10:20:03 CEST 2025
On 7/16/25 9:56 PM, Wei Gao wrote:
> On Wed, Jul 16, 2025 at 09:34:30AM +0200, Andrea Cervesato wrote:
>> On 7/16/25 9:26 PM, Wei Gao wrote:
>>> Current tst_selinux_enabled within your patchset not check running state
>>> of selinux. so i guess you need check /sys/fs/selinux/enforce value
>>> here.
>>> Or you can use tst_selinux_enforcing. Correct me if any
>>> misunderstanding.
>> If SELinux is enabled, we will have /sys/fs/selinux folder filled with files
>> that can be used to verify SELinux status (sudo sestatus -v).
>> tst_selinux_enabled() is using:
>>
>> access(SELINUX_PATH, F_OK) == 0 && !tst_dir_is_empty(SELINUX_PATH, 0)
>>
>> That is enough to know if we have SELinux or not. According to Cyril we
>> probably just need:
>>
>> tst_is_mounted(SELINUX_PATH)
>>
>> Like it is in is_selinux_enabled().
>>
>> - Andrea
>>
> If only check enable status then i guess the tst_brk message should use
> tst_brk(TCONF, "SELinux is not enabled") instead of
> tst_brk(TCONF, "SELinux is not running") ?
Right, "enabled" is more correct.
- Andrea
More information about the ltp
mailing list