From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 1/2] core: add tst_selinux_enabled() utility
Date: Wed, 9 Jul 2025 15:34:33 +0200 [thread overview]
Message-ID: <aG5v6enhdqFGgiBj@yuki.lan> (raw)
In-Reply-To: <20250709-xattr_bug_repr-v3-1-379c2c291bb7@suse.com>
Hi!
> +int tst_selinux_enabled(void)
> +{
> + int res = 0;
> +
> + if (access(SELINUX_PATH, F_OK) == 0 && !tst_dir_is_empty(SELINUX_PATH, 0))
> + res = 1;
Maybe we we can do tst_is_mounted(SELINUX_PATH) here instead. At least
that seems to be what is_selinux_enabled() seems to be doing.
> + tst_res(TINFO, "SELinux enabled: %s", res ? "yes" : "no");
> +
> + return res;
> +}
> +
> int tst_selinux_enforcing(void)
> {
> int res = 0;
>
> --
> 2.50.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-09 13:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 11:36 [LTP] [PATCH v3 0/2] Add listxattr04 test reproducer Andrea Cervesato
2025-07-09 11:36 ` [LTP] [PATCH v3 1/2] core: add tst_selinux_enabled() utility Andrea Cervesato
2025-07-09 13:34 ` Cyril Hrubis [this message]
2025-07-09 11:37 ` [LTP] [PATCH v3 2/2] Add listxattr04 reproducer Andrea Cervesato
2025-07-16 19:26 ` Wei Gao via ltp
2025-07-16 7:34 ` Andrea Cervesato via ltp
2025-07-16 19:56 ` Wei Gao via ltp
2025-07-16 8:20 ` Andrea Cervesato via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aG5v6enhdqFGgiBj@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.