Co-authored-by: Ylarod <me@ylarod.cn> Co-authored-by: 5ec1cff <56485584+5ec1cff@users.noreply.github.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Co-authored-by: u9521 <63995396+u9521@users.noreply.github.com> Co-authored-by: Wang Han <416810799@qq.com> Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Co-authored-by: Faris <rissu.ntk@gmail.com>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
#ifndef __KSU_H_SELINUX_DEFS
|
|
#define __KSU_H_SELINUX_DEFS
|
|
|
|
#include "selinux.h"
|
|
#include "objsec.h"
|
|
#ifdef SAMSUNG_SELINUX_PORTING
|
|
#include "security.h" // Samsung SELinux Porting
|
|
#endif
|
|
#ifndef KSU_COMPAT_USE_SELINUX_STATE
|
|
#include "avc.h"
|
|
#endif
|
|
|
|
#ifdef CONFIG_SECURITY_SELINUX_DISABLE
|
|
#ifdef KSU_COMPAT_USE_SELINUX_STATE
|
|
#define is_selinux_disabled() (selinux_state.disabled)
|
|
#else
|
|
#define is_selinux_disabled() (selinux_disabled)
|
|
#endif
|
|
#else
|
|
#define is_selinux_disabled() (0)
|
|
#endif
|
|
|
|
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
|
|
#ifdef KSU_COMPAT_USE_SELINUX_STATE
|
|
#define __is_selinux_enforcing() (selinux_state.enforcing)
|
|
#define __setenforce(val) selinux_state.enforcing = val
|
|
#elif defined(SAMSUNG_SELINUX_PORTING) || !defined(KSU_COMPAT_USE_SELINUX_STATE)
|
|
#define __is_selinux_enforcing() (selinux_enforcing)
|
|
#define __setenforce(val) selinux_enforcing = val
|
|
#endif
|
|
#else
|
|
#define __is_selinux_enforcing() (1)
|
|
#define __setenforce(val)
|
|
#endif
|
|
|
|
#ifdef KSU_OPTIONAL_SELINUX_CRED
|
|
#define __selinux_cred(cred) (selinux_cred(cred))
|
|
#else
|
|
#define __selinux_cred(cred) (cred->security)
|
|
#endif
|
|
|
|
#endif |