From 0a2b37bd9b78e0b03d22c0c7a8da519dcf4de2ae Mon Sep 17 00:00:00 2001 From: xlei1030 Date: Thu, 10 Mar 2022 10:33:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9paraper?= =?UTF-8?q?m=5Fcheck=E4=B8=BA=E5=8A=A8=E6=80=81=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xlei1030 --- BUILD.gn | 6 +++--- bundle.json | 4 ++-- test/BUILD.gn | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 25f7d3a69..220cd58f1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -132,8 +132,8 @@ ohos_static_library("libselinux_klog_static") { subsystem_name = "security" } -ohos_static_library("libparaperm_checker_static") { - output_name = "libparaperm_checker_static" +ohos_shared_library("libparaperm_checker") { + output_name = "libparaperm_checker" sources = [ "$SELINUX_ROOT_DIR/interfaces/policycoreutils/src/paraperm_checker.cpp", ] @@ -248,7 +248,7 @@ ohos_executable("param_check") { "$LIBSELINUX_ROOT_DIR/include", ] deps = [ - ":libparaperm_checker_static", + ":libparaperm_checker", ":libselinux_error_static", "$THIRD_PARTY_SELINUX_DIR:libselinux", ] diff --git a/bundle.json b/bundle.json index 605e9846a..27caf6c36 100644 --- a/bundle.json +++ b/bundle.json @@ -60,10 +60,10 @@ } }, { - "name": "//base/security/selinux:libparaperm_checker_static", + "name": "//base/security/selinux:libparaperm_checker", "header": { "header_files": [ - "parameter_selinux.h" + "selinux_parameter.h" ], "header_base": "//base/security/selinux/interfaces/policycoreutils/include" } diff --git a/test/BUILD.gn b/test/BUILD.gn index de6d94f49..b03e30236 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -40,7 +40,7 @@ ohos_unittest("selinux_unittest") { "//utils/native/base:utils", ] - external_deps = [ "selinux:libparaperm_checker_static" ] + external_deps = [ "selinux:libparaperm_checker" ] } group("unittest") { -- Gitee From 22ccc84a5139cf8b9ae32cd455eee79e5b2575e4 Mon Sep 17 00:00:00 2001 From: zhaoruiyuan Date: Tue, 15 Mar 2022 14:49:27 +0800 Subject: [PATCH 2/2] config selinux policy and context for thermal_protector Change-Id: Ic6927694f862eaa06f10ebfa7c67d5da0358596b Signed-off-by: zhaoruiyuan --- sepolicy/base/public/domain.te | 4 ++++ sepolicy/base/system/file_contexts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sepolicy/base/public/domain.te b/sepolicy/base/public/domain.te index de228fa1e..c3ff42291 100644 --- a/sepolicy/base/public/domain.te +++ b/sepolicy/base/public/domain.te @@ -169,6 +169,10 @@ type storage_daemon, domain; type storage_daemon_exec, exec_type, file_type, system_file_type; domain_auto_transition_pattern(init, storage_daemon_exec, storage_daemon); +type thermal_protector, domain; +type thermal_protector_exec, exec_type, file_type, system_file_type; +domain_auto_transition_pattern(init, thermal_protector_exec, thermal_protector); + type sh, domain; type sh_exec, exec_type, file_type, system_file_type; domain_auto_transition_pattern(init, sh_exec, sh); diff --git a/sepolicy/base/system/file_contexts b/sepolicy/base/system/file_contexts index 6da27ef92..aeb16d689 100644 --- a/sepolicy/base/system/file_contexts +++ b/sepolicy/base/system/file_contexts @@ -188,6 +188,8 @@ /system/bin/storage_daemon u:object_r:storage_daemon_exec:s0 +/system/bin/thermal_protector u:object_r:thermal_protector_exec:s0 + /system/bin/sh u:object_r:sh_exec:s0 /system/bin/hdcd u:object_r:hdcd_exec:s0 -- Gitee