diff options
author | Kevin | 2014-11-15 10:00:36 +0800 |
---|---|---|
committer | Kevin | 2014-11-15 10:00:36 +0800 |
commit | 9d40ac5867b9aefe0722bc1f110b965ff294d30d (patch) | |
tree | de942df665fac4bac0d9cb7ae86910fe937b0c1a /ANDROID_3.4.5/security/selinux/hooks.c | |
parent | 392e8802486cb573b916e746010e141a75f507e6 (diff) | |
download | FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.tar.gz FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.tar.bz2 FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.zip |
add via modify part source code for wm8880 4.4 kitkat
Diffstat (limited to 'ANDROID_3.4.5/security/selinux/hooks.c')
-rw-r--r-- | ANDROID_3.4.5/security/selinux/hooks.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ANDROID_3.4.5/security/selinux/hooks.c b/ANDROID_3.4.5/security/selinux/hooks.c index d85b793c..581b8c71 100644 --- a/ANDROID_3.4.5/security/selinux/hooks.c +++ b/ANDROID_3.4.5/security/selinux/hooks.c @@ -5717,8 +5717,33 @@ static struct security_operations selinux_ops = { #endif }; +extern int wmt_getsyspara(char *varname, unsigned char *varval, int *varlen); + static __init int selinux_init(void) { + // 2013-12-10 YJChen: Add Begin + char selinux_env_name[] = "wmt.selinux.param"; + char selinux_env_buf[32] = "0"; + int varlen = 32; + unsigned int nEnable = 0; + + if (wmt_getsyspara(selinux_env_name, selinux_env_buf, &varlen) == 0) { + sscanf(selinux_env_buf, "%x", &nEnable); + printk("wmt.selinux.param = %x\n", nEnable); + if (nEnable != 0x1) { + printk("setting disable selinux\n"); + selinux_enabled = 0; + return 0; + } + } + else { + // not define wmt.selinux.param, default disable + printk("default disable selinux\n"); + selinux_enabled = 0; + return 0; + } + // 2013-12-10 YJChen: Add End + if (!security_module_enable(&selinux_ops)) { selinux_enabled = 0; return 0; |