[LTP] [PATCH v3 2/2] Add listxattr04 reproducer

Andrea Cervesato andrea.cervesato@suse.com
Wed Jul 16 09:34:30 CEST 2025


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



More information about the ltp mailing list