From 2039ba4d4f9338d658984875f28efaee1566e835 Mon Sep 17 00:00:00 2001 From: winnieHu Date: Wed, 25 May 2022 17:18:58 +0800 Subject: [PATCH] change system permission to uid 3333 Signed-off-by: winnieHu --- .../os_adapter/impl/src/linux/hc_dev_info.c | 6 +++--- .../src/standard/deviceauth_service.cfg | 13 ++++++++++-- frameworks/src/standard/deviceauth_service.rc | 21 ------------------- 3 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 frameworks/src/standard/deviceauth_service.rc diff --git a/deps_adapter/os_adapter/impl/src/linux/hc_dev_info.c b/deps_adapter/os_adapter/impl/src/linux/hc_dev_info.c index 5d7ffb4..c00e27d 100644 --- a/deps_adapter/os_adapter/impl/src/linux/hc_dev_info.c +++ b/deps_adapter/os_adapter/impl/src/linux/hc_dev_info.c @@ -39,7 +39,7 @@ int32_t HcGetUdid(uint8_t *udid, int32_t udidLen) const char *GetStoragePath(void) { #ifndef LITE_DEVICE - const char *storageFile = "/data/data/deviceauth/hcgroup.dat"; + const char *storageFile = "/data/service/el1/public/deviceauth/hcgroup.dat"; #else const char *storageFile = "/storage/deviceauth/hcgroup.dat"; #endif @@ -50,7 +50,7 @@ const char *GetStoragePath(void) const char *GetStorageDirPath(void) { #ifndef LITE_DEVICE - const char *storageFile = "/data/data/deviceauth"; + const char *storageFile = "/data/service/el1/public/deviceauth"; #else const char *storageFile = "/storage/deviceauth"; #endif @@ -61,7 +61,7 @@ const char *GetStorageDirPath(void) const char *GetAccountStoragePath(void) { #ifndef LITE_DEVICE - const char *storageFile = "/data/data/deviceauth/account"; + const char *storageFile = "/data/service/el1/public/deviceauth/account"; #else const char *storageFile = "/storage/deviceauth/account"; #endif diff --git a/frameworks/src/standard/deviceauth_service.cfg b/frameworks/src/standard/deviceauth_service.cfg index 7381dad..d4e8623 100644 --- a/frameworks/src/standard/deviceauth_service.cfg +++ b/frameworks/src/standard/deviceauth_service.cfg @@ -1,9 +1,18 @@ { + "jobs" : [{ + "name" : "post-fs-data", + "cmds" : [ + "mkdir /data/service/el1/public/deviceauth 0711 deviceauth deviceauth", + "mkdir /data/service/el1/public/deviceauth/account 0711 deviceauth deviceauth", + "start deviceauth_service" + ] + } + ], "services" : [{ "name" : "deviceauth_service", "path" : ["/system/bin/deviceauth_service"], - "uid" : "system", - "gid" : ["system", "shell"] + "uid" : "deviceauth", + "gid" : ["deviceauth", "shell"] } ] } diff --git a/frameworks/src/standard/deviceauth_service.rc b/frameworks/src/standard/deviceauth_service.rc deleted file mode 100644 index 09c436e..0000000 --- a/frameworks/src/standard/deviceauth_service.rc +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2021 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. - -on post-fs-data - start deviceauth_service - -service deviceauth_service /system/bin/deviceauth_service - class z_core - user system - group system shell - seclabel u:r:deviceauth_service:s0