diff --git a/common/hal_sdk/useriam_common.cpp b/common/hal_sdk/useriam_common.cpp index b05dbf1e92156aaf2d2bdc22bca2cadce4585451..bc824c08139b9b734797467bc6dc7dea406460a0 100644 --- a/common/hal_sdk/useriam_common.cpp +++ b/common/hal_sdk/useriam_common.cpp @@ -31,16 +31,11 @@ extern "C" { namespace OHOS { namespace UserIAM { namespace Common { -static const char *IDM_USER_FOLDER = "/data/useriam"; static bool g_isInitUserIAM = false; int32_t Init() { GlobalLock(); - LOG_INFO("check useriam folder exist or init it"); - if (IDM_USER_FOLDER && access(IDM_USER_FOLDER, 0) == -1) { - mkdir(IDM_USER_FOLDER, S_IRWXU); - } if (InitUserAuthContextList() != RESULT_SUCCESS) { LOG_ERROR("init user auth failed"); goto FAIL; diff --git a/sa_profile/BUILD.gn b/sa_profile/BUILD.gn index b30e741f3fd830731d4db3cd45a6de24d9695bd0..5a9101bc498f3d6908420b821cff93f451197019 100644 --- a/sa_profile/BUILD.gn +++ b/sa_profile/BUILD.gn @@ -19,11 +19,7 @@ ohos_sa_profile("coauth_sa_profile") { part_name = "${coauth_native_part_name}" } ohos_prebuilt_etc("useriam.init") { - if (use_musl) { - source = "useriam.cfg" - } else { - source = "useriam.rc" - } + source = "useriam.cfg" relative_install_dir = "init" part_name = "auth_executor_mgr" subsystem_name = "useriam" diff --git a/sa_profile/useriam.cfg b/sa_profile/useriam.cfg index e1e673c5d77175ea9e65f09b24e0ff8a79794f5d..af3b03adc47ef42e877f4d81157476bc849a6d13 100644 --- a/sa_profile/useriam.cfg +++ b/sa_profile/useriam.cfg @@ -1,10 +1,20 @@ { + "jobs" : [{ + "name" : "service:useriam", + "cmds" : [ + "mkdir /data/useriam/ 0700 system system" + ] + } + ], "services" : [{ "name" : "useriam", "path" : ["/system/bin/sa_main", "/system/profile/useriam.xml"], "uid" : "system", "gid" : ["system", "shell"], - "secon" : "u:r:useriam:s0" + "secon" : "u:r:useriam:s0", + "jobs" : { + "on-start" : "service:useriam" + } } ] } diff --git a/sa_profile/useriam.rc b/sa_profile/useriam.rc deleted file mode 100644 index 293c6458945e0346b2336e72027587f33e6a8df5..0000000000000000000000000000000000000000 --- a/sa_profile/useriam.rc +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - -service useriam /system/bin/sa_main /system/profile/useriam.xml - class z_core - user system - group system shell - seclabel u:r:useriam:s0 \ No newline at end of file