From fd1d98a48f65041add45e4a607e6f8c056c889e0 Mon Sep 17 00:00:00 2001 From: chuangda_1 Date: Sat, 27 May 2023 18:48:28 +0800 Subject: [PATCH 1/4] add print policy Signed-off-by: chuangda_1 --- .../print/print_service/system/print_service.te | 1 - .../print/print_service/system/security_guard.te | 14 ++++++++++++++ .../print/print_service/system/time_service.te | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 sepolicy/ohos_policy/print/print_service/system/security_guard.te create mode 100644 sepolicy/ohos_policy/print/print_service/system/time_service.te diff --git a/sepolicy/ohos_policy/print/print_service/system/print_service.te b/sepolicy/ohos_policy/print/print_service/system/print_service.te index e67729d58..2dc2e848b 100644 --- a/sepolicy/ohos_policy/print/print_service/system/print_service.te +++ b/sepolicy/ohos_policy/print/print_service/system/print_service.te @@ -68,4 +68,3 @@ allow print_service system_basic_hap:fd { use }; allow print_service system_basic_hap_data_file:file { read }; allow print_service system_core_hap:binder { call }; allow print_service sysfs_devices_system_cpu:file { open read }; - diff --git a/sepolicy/ohos_policy/print/print_service/system/security_guard.te b/sepolicy/ohos_policy/print/print_service/system/security_guard.te new file mode 100644 index 000000000..dd77760a8 --- /dev/null +++ b/sepolicy/ohos_policy/print/print_service/system/security_guard.te @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +allow security_guard print_service:binder { transfer }; diff --git a/sepolicy/ohos_policy/print/print_service/system/time_service.te b/sepolicy/ohos_policy/print/print_service/system/time_service.te new file mode 100644 index 000000000..e611fec84 --- /dev/null +++ b/sepolicy/ohos_policy/print/print_service/system/time_service.te @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +allow time_service print_service :binder { transfer }; -- Gitee From 6424ed3186bc2e6b6568e2b3a78aa7ea615993dc Mon Sep 17 00:00:00 2001 From: chuangda_1 Date: Sat, 27 May 2023 18:53:22 +0800 Subject: [PATCH 2/4] add print policy Signed-off-by: chuangda_1 --- .../ohos_policy/print/print_service/system/print_service.te | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sepolicy/ohos_policy/print/print_service/system/print_service.te b/sepolicy/ohos_policy/print/print_service/system/print_service.te index 2dc2e848b..7dd3941ad 100644 --- a/sepolicy/ohos_policy/print/print_service/system/print_service.te +++ b/sepolicy/ohos_policy/print/print_service/system/print_service.te @@ -68,3 +68,7 @@ allow print_service system_basic_hap:fd { use }; allow print_service system_basic_hap_data_file:file { read }; allow print_service system_core_hap:binder { call }; allow print_service sysfs_devices_system_cpu:file { open read }; +allow print_service sa_security_guard_service:samgr_class { get }; +allow print_service sa_time_service:samgr_class { get }; +allow print_service security_guard:binder { call }; +allow print_service time_service:binder { call }; -- Gitee From bad0e44de9c58e8402324cd69f3a4d497c5963dc Mon Sep 17 00:00:00 2001 From: chuangda_1 Date: Sat, 27 May 2023 18:54:24 +0800 Subject: [PATCH 3/4] add print policy Signed-off-by: chuangda_1 --- sepolicy/ohos_policy/print/print_service/system/print_service.te | 1 + 1 file changed, 1 insertion(+) diff --git a/sepolicy/ohos_policy/print/print_service/system/print_service.te b/sepolicy/ohos_policy/print/print_service/system/print_service.te index 7dd3941ad..408f0ef59 100644 --- a/sepolicy/ohos_policy/print/print_service/system/print_service.te +++ b/sepolicy/ohos_policy/print/print_service/system/print_service.te @@ -72,3 +72,4 @@ allow print_service sa_security_guard_service:samgr_class { get }; allow print_service sa_time_service:samgr_class { get }; allow print_service security_guard:binder { call }; allow print_service time_service:binder { call }; + -- Gitee From eaf4457d694e39e962e6259dd0f109911e312ce3 Mon Sep 17 00:00:00 2001 From: chuangda_1 Date: Sat, 27 May 2023 19:25:01 +0800 Subject: [PATCH 4/4] add print policy Signed-off-by: chuangda_1 --- .../ohos_policy/print/print_service/system/security_guard.te | 2 +- sepolicy/ohos_policy/print/print_service/system/time_service.te | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sepolicy/ohos_policy/print/print_service/system/security_guard.te b/sepolicy/ohos_policy/print/print_service/system/security_guard.te index dd77760a8..5a6de5dd0 100644 --- a/sepolicy/ohos_policy/print/print_service/system/security_guard.te +++ b/sepolicy/ohos_policy/print/print_service/system/security_guard.te @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/sepolicy/ohos_policy/print/print_service/system/time_service.te b/sepolicy/ohos_policy/print/print_service/system/time_service.te index e611fec84..5c6b67b9f 100644 --- a/sepolicy/ohos_policy/print/print_service/system/time_service.te +++ b/sepolicy/ohos_policy/print/print_service/system/time_service.te @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -- Gitee