selinux: use grep to check api supports (#402)

This checks `selinux_state` and `current_sid` supports in a raw way.
Feels more reliable than the version checks.

Supersedes #401, fixes #280, fixes #400.
This commit is contained in:
2023-04-20 15:22:03 +08:00
committed by GitHub
parent 3b9cab3432
commit 3452841752
4 changed files with 19 additions and 9 deletions

View File

@@ -2,6 +2,11 @@
#define __KSU_H_SELINUX
#include "linux/types.h"
#include "linux/version.h"
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || defined(KSU_COMPAT_HAS_SELINUX_STATE)
#define KSU_COMPAT_USE_SELINUX_STATE
#endif
void setup_selinux();