From 389bd4dbf906ee348227f764612a6127d427eb3d Mon Sep 17 00:00:00 2001 From: zhang Date: Wed, 9 Mar 2022 20:15:48 +0800 Subject: [PATCH 01/29] fix: modify hdf host uid and gid name Signed-off-by: zhang --- services/etc/group | 24 ++++++++++++++++++++++++ services/etc/param/ohos.para.dac | 2 +- services/etc/passwd | 24 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/services/etc/group b/services/etc/group index 43295ee53..905886a0b 100755 --- a/services/etc/group +++ b/services/etc/group @@ -32,5 +32,29 @@ wakelock:x:3010: uhid:x:3011: ddms:x:3012: access_token:x:3020: +blue_host:x:3021: +sample_host:x:3022: +usb_host:x:3023: +usbfnMaster_host:x:3024: +power_host:x:3025: +wifi_host:x:3026: +audio_hdi_server_host:x:3027: +camera_host:x:3028: +input_user_host:x:3029: +display_gralloc_host:x:3030: +codec_host:x:3031: +riladapter_host:x:3032: +sensor_dal_host:x:3033: +vibrator_dal_host:x:3034: +light_dal_host:x:3035: +wifi_c_host:x:3036: +disp_gralloc_host:x:3037: +dcamera_host:x:3038: +hwc_host:x:3039: +gralloc_host:x:3040: +sensor_host:x:3041: +nfc_host:x:3042: +a2dp_host:x:3043: +hdf_devmgr:x:3044: misc:x:9998: app:x:10000: diff --git a/services/etc/param/ohos.para.dac b/services/etc/param/ohos.para.dac index bf21971c4..32db74f8d 100755 --- a/services/etc/param/ohos.para.dac +++ b/services/etc/param/ohos.para.dac @@ -26,7 +26,7 @@ const.debuggable root:root:0777 persist.sys.usb.config root:root:0777 # default forbit other user to start service -ohos.servicectrl. system:root:0770 +ohos.servicectrl. system:root:0777 test.permission. root:root:0770 test.permission.read. root:root:0774 test.permission.write. root:root:0772 diff --git a/services/etc/passwd b/services/etc/passwd index 873a182c2..7dfdf1cf7 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -33,6 +33,30 @@ wakelock:x:3010:3010:::/bin/false uhid:x:3011:3011:::/bin/false ddms:x:3012:3012:::/bin/false access_token:x:3020:3020:::/bin/false +blue_host:x:3021:3021:::/bin/false +sample_host:x:3022:3022:::/bin/false +usb_host:x:3023:3023:::/bin/false +usbfnMaster_host:x:3024:3024:::/bin/false +power_host:x:3025:3025:::/bin/false +wifi_host:x:3026:3026:::/bin/false +audio_hdi_server_host:x:3027:3027:::/bin/false +camera_host:x:3028:3028:::/bin/false +input_user_host:x:3029:3029:::/bin/false +display_gralloc_host:x:3030:3030:::/bin/false +codec_host:x:3031:3031:::/bin/false +riladapter_host:x:3032:3032:::/bin/false +sensor_dal_host:x:3033:3033:::/bin/false +vibrator_dal_host:x:3034:3034:::/bin/false +light_dal_host:x:3035:3035:::/bin/false +wifi_c_host:x:3036:3036:::/bin/false +disp_gralloc_host:x:3037:3037:::/bin/false +dcamera_host:x:3038:3038:::/bin/false +hwc_host:x:3039:3039:::/bin/false +gralloc_host:x:3040:3040:::/bin/false +sensor_host:x:3041:3041:::/bin/false +nfc_host:x:3042:3042:::/bin/false +a2dp_host:x:3043:3043:::/bin/false +hdf_devmgr:x:3044:3044:::/bin/false dms:x:5522:5522:::/bin/false misc:x:9998:9998:::/bin/false app:x:10000:10000:::/bin/false From 6790203a9a3639ef8a8bbf1ba8ef599ad8f5acfa Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Fri, 11 Mar 2022 17:27:37 +0800 Subject: [PATCH 02/29] init: fix watcher_dog Signed-off-by: xionglei6 --- watchdog/init_watchdog.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/watchdog/init_watchdog.c b/watchdog/init_watchdog.c index a8021760c..277ee7bca 100755 --- a/watchdog/init_watchdog.c +++ b/watchdog/init_watchdog.c @@ -15,13 +15,17 @@ #include #include +#include #include #include +#include #include #include #include #include +#include "sched.h" + #ifdef LINUX_WATCHDOG #include #else @@ -75,7 +79,9 @@ int main(int argc, const char *argv[]) gap = (gap > 0) ? gap : DEFAULT_GAP; INIT_LOGI("watchdoge started (interval %d, margin %d), fd = %d\n", interval, gap, fd); - + if (setpriority(PRIO_PROCESS, 0, 14) != 0) { // 14 is process priority + INIT_LOGE("setpriority failed err=%d\n", errno); + } int timeoutSet = interval + gap; int timeoutGet = 0; int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeoutSet); From 1867ac1c46d33c932d62c4e60b719f71786cdb63 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Fri, 11 Mar 2022 19:14:57 +0800 Subject: [PATCH 03/29] init: fix bugs Signed-off-by: xionglei6 --- watchdog/BUILD.gn | 5 ++++- watchdog/init_watchdog.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/watchdog/BUILD.gn b/watchdog/BUILD.gn index 395d2214c..1fafd7a1d 100755 --- a/watchdog/BUILD.gn +++ b/watchdog/BUILD.gn @@ -23,7 +23,10 @@ if (defined(ohos_lite)) { "//base/startup/init_lite/interfaces/innerkits/include", ] deps = [ "//base/startup/init_lite/services/log:init_log" ] - defines = [ "_GNU_SOURCE" ] + defines = [ + "_GNU_SOURCE", + "OHOS_LITE_WATCHDOG" + ] if (ohos_kernel_type == "linux") { defines += [ "LINUX_WATCHDOG" ] } diff --git a/watchdog/init_watchdog.c b/watchdog/init_watchdog.c index 277ee7bca..19294cff6 100755 --- a/watchdog/init_watchdog.c +++ b/watchdog/init_watchdog.c @@ -79,9 +79,13 @@ int main(int argc, const char *argv[]) gap = (gap > 0) ? gap : DEFAULT_GAP; INIT_LOGI("watchdoge started (interval %d, margin %d), fd = %d\n", interval, gap, fd); +#ifdef OHOS_LITE_WATCHDOG +#ifndef LINUX_WATCHDOG if (setpriority(PRIO_PROCESS, 0, 14) != 0) { // 14 is process priority INIT_LOGE("setpriority failed err=%d\n", errno); } +#endif +#endif int timeoutSet = interval + gap; int timeoutGet = 0; int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeoutSet); From 2968dbcfb6e16f936eee129133d421a5f3df66ae Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Fri, 11 Mar 2022 19:16:53 +0800 Subject: [PATCH 04/29] init: fix format Signed-off-by: xionglei6 --- watchdog/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watchdog/BUILD.gn b/watchdog/BUILD.gn index 1fafd7a1d..27b4bc5bb 100755 --- a/watchdog/BUILD.gn +++ b/watchdog/BUILD.gn @@ -25,7 +25,7 @@ if (defined(ohos_lite)) { deps = [ "//base/startup/init_lite/services/log:init_log" ] defines = [ "_GNU_SOURCE", - "OHOS_LITE_WATCHDOG" + "OHOS_LITE_WATCHDOG", ] if (ohos_kernel_type == "linux") { defines += [ "LINUX_WATCHDOG" ] From 6ec26d00095c6ea5ec0facf2094fe6f9bd83c457 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Fri, 11 Mar 2022 19:58:12 +0800 Subject: [PATCH 05/29] init: fix bugs Signed-off-by: xionglei6 --- watchdog/init_watchdog.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/watchdog/init_watchdog.c b/watchdog/init_watchdog.c index 19294cff6..cc5038ba2 100755 --- a/watchdog/init_watchdog.c +++ b/watchdog/init_watchdog.c @@ -24,8 +24,6 @@ #include #include -#include "sched.h" - #ifdef LINUX_WATCHDOG #include #else From a1ed221ac9a82ca617091984cdfa0891f1318089 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Sat, 12 Mar 2022 17:12:10 +0800 Subject: [PATCH 06/29] init: remove lib/platform-vndk Signed-off-by: xionglei6 --- interfaces/innerkits/socket/BUILD.gn | 1 - services/log/BUILD.gn | 1 - 2 files changed, 2 deletions(-) diff --git a/interfaces/innerkits/socket/BUILD.gn b/interfaces/innerkits/socket/BUILD.gn index 9273eaf61..844591938 100644 --- a/interfaces/innerkits/socket/BUILD.gn +++ b/interfaces/innerkits/socket/BUILD.gn @@ -50,6 +50,5 @@ if (defined(ohos_lite)) { "system", "updater", ] - relative_install_dir = "platform-vndk" } } diff --git a/services/log/BUILD.gn b/services/log/BUILD.gn index b8e404afe..ba3f7403b 100755 --- a/services/log/BUILD.gn +++ b/services/log/BUILD.gn @@ -40,7 +40,6 @@ if (defined(ohos_lite)) { "system", "updater", ] - relative_install_dir = "platform-vndk" install_enable = true part_name = "init" subsystem_name = "startup" From e5adcbfa83046b9b413cd571929b0cf51545b68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E9=92=A6=E6=97=AD?= Date: Sat, 12 Mar 2022 10:02:15 +0000 Subject: [PATCH 07/29] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddev/fuse=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98=EF=BC=9A=20Signed-off-by:=20panqinx?= =?UTF-8?q?u=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/etc/init.cfg | 3 ++- services/etc/init.without_two_stages.cfg | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/etc/init.cfg b/services/etc/init.cfg index 1e38e0e1c..bf1b4da54 100755 --- a/services/etc/init.cfg +++ b/services/etc/init.cfg @@ -313,7 +313,8 @@ "mkdir /data/init_agent 0770 shell system", "setparam sys.use_memfd false", "chown root system /dev/fscklogs/log", - "chmod 0770 /dev/fscklogs/log" + "chmod 0770 /dev/fscklogs/log", + "chmod 0660 /dev/fuse" ] }, { "name" : "boot", diff --git a/services/etc/init.without_two_stages.cfg b/services/etc/init.without_two_stages.cfg index 4a0e1bebe..210d4a096 100755 --- a/services/etc/init.without_two_stages.cfg +++ b/services/etc/init.without_two_stages.cfg @@ -303,7 +303,8 @@ "mkdir /data/init_agent 0770 shell system", "setparam sys.use_memfd false", "chown root system /dev/fscklogs/log", - "chmod 0770 /dev/fscklogs/log" + "chmod 0770 /dev/fscklogs/log", + "chmod 0660 /dev/fuse" ] }, { "name" : "boot", From c5f67e9e8cafb27b9a74413064f5e4167d940af6 Mon Sep 17 00:00:00 2001 From: knpingan Date: Mon, 14 Mar 2022 10:26:23 +0800 Subject: [PATCH 08/29] nfc connected tag for master of hdf driver. Signed-off-by: knpingan --- services/etc/group | 1 + services/etc/passwd | 1 + 2 files changed, 2 insertions(+) diff --git a/services/etc/group b/services/etc/group index 905886a0b..8f5ad95c4 100755 --- a/services/etc/group +++ b/services/etc/group @@ -56,5 +56,6 @@ sensor_host:x:3041: nfc_host:x:3042: a2dp_host:x:3043: hdf_devmgr:x:3044: +connected_tag_host:x:3045: misc:x:9998: app:x:10000: diff --git a/services/etc/passwd b/services/etc/passwd index 7dfdf1cf7..29439d274 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -57,6 +57,7 @@ sensor_host:x:3041:3041:::/bin/false nfc_host:x:3042:3042:::/bin/false a2dp_host:x:3043:3043:::/bin/false hdf_devmgr:x:3044:3044:::/bin/false +connected_tag_host:x:3045:3045:::/bin/false dms:x:5522:5522:::/bin/false misc:x:9998:9998:::/bin/false app:x:10000:10000:::/bin/false From 5976da3ed34d21cee12366f7f2967330492f45c2 Mon Sep 17 00:00:00 2001 From: Anurup M Date: Mon, 14 Mar 2022 21:46:57 +0530 Subject: [PATCH 09/29] change audioserver UID and GID to audio Signed-off-by: Anurup M --- services/etc/group | 2 +- services/etc/init.cfg | 2 +- services/etc/init.without_two_stages.cfg | 2 +- services/etc/passwd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/etc/group b/services/etc/group index 905886a0b..67031bd60 100755 --- a/services/etc/group +++ b/services/etc/group @@ -21,7 +21,7 @@ sdcard_r:x:1028: package_info:x:1032: logd:x:1036: shared_relro:x:1037: -audioserver:x:1041: +audio:x:1041: cameraserver:x:1047: shell:x:2000: cache:x:2001: diff --git a/services/etc/init.cfg b/services/etc/init.cfg index 1e38e0e1c..73fa06d25 100755 --- a/services/etc/init.cfg +++ b/services/etc/init.cfg @@ -255,7 +255,7 @@ "chmod 0660 /data/misc/wifi/wpa_supplicant.conf", "mkdir /data/local 0751 root root", "mkdir /data/misc/media 0700 media media", - "mkdir /data/misc/audioserver 0700 audioserver audioserver", + "mkdir /data/misc/audio 0700 audio audio", "mkdir /data/misc/cameraserver 0700 cameraserver cameraserver", "mkdir /data/misc/vold 0700 root root", "mkdir /data/misc/boottrace 0771 system shell", diff --git a/services/etc/init.without_two_stages.cfg b/services/etc/init.without_two_stages.cfg index 4a0e1bebe..9f3f3ae58 100755 --- a/services/etc/init.without_two_stages.cfg +++ b/services/etc/init.without_two_stages.cfg @@ -245,7 +245,7 @@ "chmod 0660 /data/misc/wifi/wpa_supplicant.conf", "mkdir /data/local 0751 root root", "mkdir /data/misc/media 0700 media media", - "mkdir /data/misc/audioserver 0700 audioserver audioserver", + "mkdir /data/misc/audio 0700 audio audio", "mkdir /data/misc/cameraserver 0700 cameraserver cameraserver", "mkdir /data/misc/vold 0700 root root", "mkdir /data/misc/boottrace 0771 system shell", diff --git a/services/etc/passwd b/services/etc/passwd index 7dfdf1cf7..e24b8dd1f 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -22,7 +22,7 @@ sdcard_r:x:1028:1028:::/bin/false package_info:x:1032:1032:::/bin/false logd:x:1036:1036:::/bin/false shared_relro:x:1037:1037:::/bin/false -audioserver:x:1041:1041:::/bin/false +audio:x:1041:1041:::/bin/false cameraserver:x:1047:1047:::/bin/false shell:x:2000:2000:::/bin/false cache:x:2001:2001:::/bin/false From f6659018624d5b271751a53aa182e8e3b2c1a576 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Tue, 15 Mar 2022 16:12:23 +0800 Subject: [PATCH 10/29] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0native=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xionglei6 --- device_info/device_info_stub.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/device_info/device_info_stub.cpp b/device_info/device_info_stub.cpp index b7e191cf5..8752c0b3c 100755 --- a/device_info/device_info_stub.cpp +++ b/device_info/device_info_stub.cpp @@ -77,9 +77,7 @@ bool DeviceInfoStub::CheckPermission(MessageParcel &data, const std::string &per int32_t result = TypePermissionState::PERMISSION_GRANTED; int32_t tokenType = AccessTokenKit::GetTokenTypeFlag(callerToken); if (tokenType == TOKEN_NATIVE) { -#ifdef SUPPORT_NATIVE result = AccessTokenKit::VerifyNativeToken(callerToken, permission); -#endif } else if (tokenType == TOKEN_HAP) { result = AccessTokenKit::VerifyAccessToken(callerToken, permission); } else { @@ -90,7 +88,7 @@ bool DeviceInfoStub::CheckPermission(MessageParcel &data, const std::string &per DINFO_LOGE("AccessTokenID:%d, permission:%s denied!", callerToken, permission.c_str()); return false; } - DINFO_LOGI("dAccessTokenID:%d, permission:%s matched!", callerToken, permission.c_str()); + DINFO_LOGI("tokenType %d dAccessTokenID:%d, permission:%s matched!", tokenType, callerToken, permission.c_str()); return true; } From 9f10e612e65152afc02af4224195c17356aca1fd Mon Sep 17 00:00:00 2001 From: zhangfeng Date: Wed, 16 Mar 2022 07:17:42 +0000 Subject: [PATCH 11/29] fix security issues Signed-off-by: zhangfeng Change-Id: I173e35d17c2f7ac6aa56451d2c290bcf2ae82f0d --- services/etc/init.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/etc/init.cfg b/services/etc/init.cfg index 1e38e0e1c..21f1982fc 100755 --- a/services/etc/init.cfg +++ b/services/etc/init.cfg @@ -245,9 +245,9 @@ "mkdir /data/misc/vpn 0770 system vpn", "mkdir /data/misc/shared_relro 0771 shared_relro shared_relro", "mkdir /data/misc/systemkeys 0700 system system", - "mkdir /data/misc/wifi 0770 wifi wifi", - "mkdir /data/misc/wifi/sockets 0770 wifi wifi", - "mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi", + "mkdir /data/misc/wifi 0770 system system", + "mkdir /data/misc/wifi/sockets 0770 system system", + "mkdir /data/misc/wifi/wpa_supplicant 0660 system system", "mkdir /data/misc/ethernet 0770 system system", "mkdir /data/misc/dhcp 0770 dhcp dhcp", "mkdir /data/misc/user 0771 root root", From 681c4a5245ec0d56eed106827c799e0335e1e1a6 Mon Sep 17 00:00:00 2001 From: ql Date: Wed, 16 Mar 2022 08:07:45 +0000 Subject: [PATCH 12/29] add dms group Signed-off-by: ql --- services/etc/group | 1 + 1 file changed, 1 insertion(+) diff --git a/services/etc/group b/services/etc/group index b0c04f3b0..b0826820b 100755 --- a/services/etc/group +++ b/services/etc/group @@ -57,5 +57,6 @@ nfc_host:x:3042: a2dp_host:x:3043: hdf_devmgr:x:3044: connected_tag_host:x:3045: +dms:x:5522: misc:x:9998: app:x:10000: From 2cb3f075fb81afc6a6c2f55770a3b9628659826b Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Thu, 17 Mar 2022 17:36:28 +0800 Subject: [PATCH 13/29] fix: codex Signed-off-by: xionglei6 --- device_info/device_info_kits.cpp | 3 ++- .../innerkits/service_control/service_control.c | 2 +- services/begetctl/main.c | 4 +++- services/begetctl/param_cmd.c | 1 + services/init/init_common_service.c | 5 ++++- services/init/standard/fd_holder_service.c | 14 +++++++++++--- services/loopevent/socket/le_socket.c | 15 ++++++++++----- 7 files changed, 32 insertions(+), 12 deletions(-) diff --git a/device_info/device_info_kits.cpp b/device_info/device_info_kits.cpp index f5cc59f98..e5e09d10a 100755 --- a/device_info/device_info_kits.cpp +++ b/device_info/device_info_kits.cpp @@ -129,7 +129,8 @@ const char *AclGetSerial(void) OHOS::device_info::DeviceInfoKits &instance = OHOS::device_info::DeviceInfoKits::GetInstance(); int ret = instance.GetSerialID(result); if (ret == 0) { - (void)strcpy_s(serialNumber, sizeof(serialNumber), result.c_str()); + ret = strcpy_s(serialNumber, sizeof(serialNumber), result.c_str()); + DINFO_CHECK(ret == 0, return -1, "Failed to copy"); } DINFO_LOGI("GetSerial %s", serialNumber); return serialNumber; diff --git a/interfaces/innerkits/service_control/service_control.c b/interfaces/innerkits/service_control/service_control.c index 0755ea4f8..1a8396f6a 100644 --- a/interfaces/innerkits/service_control/service_control.c +++ b/interfaces/innerkits/service_control/service_control.c @@ -221,7 +221,7 @@ int ServiceSetReady(const char *serviceName) BEGET_LOGE("Set param for %s failed.", paramName); return -1; } - BEGET_LOGI("Success set %d read", serviceName); + BEGET_LOGI("Success set %s read", serviceName); return 0; } diff --git a/services/begetctl/main.c b/services/begetctl/main.c index 406346eed..c062ab84f 100755 --- a/services/begetctl/main.c +++ b/services/begetctl/main.c @@ -65,7 +65,9 @@ int main(int argc, char *argv[]) args = argv + 1; } if (number >= 1 && strcmp(args[0], "devctl") == 0) { - (void)memcpy_s(args[0], strlen(args[0]), "reboot", strlen("reboot")); + if (memcpy_s(args[0], strlen(args[0]), "reboot", strlen("reboot")) != 0) { + printf("Failed to copy\n"); + } } SetInitLogLevel(0); BShellParamCmdRegister(g_handle, 0); diff --git a/services/begetctl/param_cmd.c b/services/begetctl/param_cmd.c index 0764d3738..07d0f743d 100755 --- a/services/begetctl/param_cmd.c +++ b/services/begetctl/param_cmd.c @@ -91,6 +91,7 @@ static char *GetRealParameter(BShellHandle shell, const char *name, char *buffer } else { realLen = sprintf_s(buffer, buffSize, "%s", name); } + BSH_CHECK(realLen > 0, return NULL, "Failed to format buffer"); buffer[realLen] = '\0'; BSH_LOGV("GetRealParameter current %s input %s real %s", current, name, buffer); return buffer; diff --git a/services/init/init_common_service.c b/services/init/init_common_service.c index bdb7079f3..450c35171 100755 --- a/services/init/init_common_service.c +++ b/services/init/init_common_service.c @@ -229,7 +229,10 @@ static void PublishHoldFds(Service *service) fdBuffer[pos - 1] = '\0'; // Remove last ' ' INIT_LOGI("fd buffer: [%s]", fdBuffer); char envName[MAX_BUFFER_LEN] = {}; - (void)snprintf_s(envName, MAX_BUFFER_LEN, MAX_BUFFER_LEN - 1, ENV_FD_HOLD_PREFIX"%s", service->name); + if (snprintf_s(envName, MAX_BUFFER_LEN, MAX_BUFFER_LEN - 1, ENV_FD_HOLD_PREFIX"%s", service->name) < 0) { + INIT_LOGE("snprintf_s failed err=%d", errno); + return; + } if (setenv(envName, fdBuffer, 1) < 0) { INIT_LOGE("Failed to set env %s", envName); } diff --git a/services/init/standard/fd_holder_service.c b/services/init/standard/fd_holder_service.c index 9f46a3ab9..ae0856e34 100644 --- a/services/init/standard/fd_holder_service.c +++ b/services/init/standard/fd_holder_service.c @@ -62,12 +62,17 @@ static int HandlerHoldFds(Service *service, int *fds, size_t fdCount, const char static void SendErrorInfo(int sock, const char *errInfo, const char *serviceName) { + int ret = 0; char errBuffer[MAX_FD_HOLDER_BUFFER] = {}; if (UNLIKELY(errInfo == NULL)) { // Should not happen. char *defaultError = "Unknonw error"; - (void)strncpy_s(errBuffer, MAX_FD_HOLDER_BUFFER, defaultError, strlen(defaultError)); + ret = strncpy_s(errBuffer, MAX_FD_HOLDER_BUFFER, defaultError, strlen(defaultError)); } else { - (void)strncpy_s(errBuffer, MAX_FD_HOLDER_BUFFER, errInfo, strlen(errInfo)); + ret = strncpy_s(errBuffer, MAX_FD_HOLDER_BUFFER, errInfo, strlen(errInfo)); + } + if (ret != 0) { + INIT_LOGE("Failed to copy, err = %d", errno); + return; } struct iovec iovec = { @@ -96,7 +101,10 @@ static void SendFdsInfo(int sock, Service *service) return; } char sendBuffer[MAX_FD_HOLDER_BUFFER] = {}; - (void)strncpy_s(sendBuffer, MAX_FD_HOLDER_BUFFER, "send done", strlen("send done")); + if (strncpy_s(sendBuffer, MAX_FD_HOLDER_BUFFER, "send done", strlen("send done")) != 0) { + INIT_LOGE("Failed to copy, err = %d", errno); + return; + } struct iovec iovec = { .iov_base = sendBuffer, .iov_len = strlen(sendBuffer), diff --git a/services/loopevent/socket/le_socket.c b/services/loopevent/socket/le_socket.c index 80a039f3e..78d588225 100755 --- a/services/loopevent/socket/le_socket.c +++ b/services/loopevent/socket/le_socket.c @@ -36,11 +36,15 @@ static int CreatePipeServerSocket_(const char *server, int maxClient) unlink(server); struct sockaddr_un serverAddr; - memset_s(&serverAddr, sizeof(serverAddr), 0, sizeof(serverAddr)); + int ret = memset_s(&serverAddr, sizeof(serverAddr), 0, sizeof(serverAddr)); + LE_CHECK(ret == 0, close(listenfd); + return ret, "Failed to memory set. error: %s", strerror(errno)); serverAddr.sun_family = AF_UNIX; - strcpy_s(serverAddr.sun_path, sizeof(serverAddr.sun_path), server); + ret = strcpy_s(serverAddr.sun_path, sizeof(serverAddr.sun_path), server); + LE_CHECK(ret == 0, close(listenfd); + return ret, "Failed to copy. error: %s", strerror(errno)); uint32_t size = offsetof(struct sockaddr_un, sun_path) + strlen(server); - int ret = bind(listenfd, (struct sockaddr *)&serverAddr, size); + ret = bind(listenfd, (struct sockaddr *)&serverAddr, size); LE_CHECK(ret >= 0, close(listenfd); return ret, "Failed to bind socket. error: %s", strerror(errno)); @@ -91,13 +95,14 @@ static int CreatePipeSocket_(const char *server) LE_STATUS GetSockaddrFromServer_(const char *server, struct sockaddr_in *addr) { - memset_s(addr, sizeof(struct sockaddr_in), 0, sizeof(struct sockaddr_in)); + int ret = memset_s(addr, sizeof(struct sockaddr_in), 0, sizeof(struct sockaddr_in)); + LE_CHECK(ret == 0, return ret, "Failed to memory set. error: %s", strerror(errno)); addr->sin_family = AF_INET; const char *portStr = strstr(server, ":"); LE_CHECK(portStr != NULL, return LE_FAILURE, "Failed to get addr %s", server); uint16_t port = atoi(portStr + 1); addr->sin_port = htons(port); - int ret = inet_pton(AF_INET, server, &addr->sin_addr); + ret = inet_pton(AF_INET, server, &addr->sin_addr); LE_CHECK(ret >= 0, return LE_FAILURE, "Failed to inet_pton addr %s", server); return LE_SUCCESS; } From 6f0e3351067b867c5e045ecd3c7cccf94af94aec Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Thu, 17 Mar 2022 18:02:28 +0800 Subject: [PATCH 14/29] fix: codex Signed-off-by: xionglei6 --- device_info/device_info_kits.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device_info/device_info_kits.cpp b/device_info/device_info_kits.cpp index e5e09d10a..fca182a57 100755 --- a/device_info/device_info_kits.cpp +++ b/device_info/device_info_kits.cpp @@ -130,7 +130,7 @@ const char *AclGetSerial(void) int ret = instance.GetSerialID(result); if (ret == 0) { ret = strcpy_s(serialNumber, sizeof(serialNumber), result.c_str()); - DINFO_CHECK(ret == 0, return -1, "Failed to copy"); + DINFO_CHECK(ret == 0, return nullptr, "Failed to copy"); } DINFO_LOGI("GetSerial %s", serialNumber); return serialNumber; From f87fb17f97faffb850b7637316c6f6e997b32de4 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Thu, 17 Mar 2022 21:42:26 +0800 Subject: [PATCH 15/29] =?UTF-8?q?fix=EF=BC=9Aut=E7=94=A8=E4=BE=8B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xionglei6 --- test/unittest/BUILD.gn | 2 ++ test/unittest/init/service_socket_unittest.cpp | 4 +++- test/unittest/param/watcher_agent_unittest.cpp | 10 +++++++++- test/unittest/param/watcher_proxy_unittest.cpp | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index d48273cde..9864d1169 100755 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -185,6 +185,8 @@ ohos_unittest("init_ut") { ] defines = [ + "READ_CHECK", + "PARAM_SUPPORT_DAC_CHECK", "INIT_AGENT", "STARTUP_INIT_TEST", "PARAM_SUPPORT_SAVE_PERSIST", diff --git a/test/unittest/init/service_socket_unittest.cpp b/test/unittest/init/service_socket_unittest.cpp index b24857a4a..783a288f7 100755 --- a/test/unittest/init/service_socket_unittest.cpp +++ b/test/unittest/init/service_socket_unittest.cpp @@ -38,7 +38,9 @@ HWTEST_F(ServiceSocketUnitTest, TestCreateSocket, TestSize.Level0) ASSERT_NE(service, nullptr); ServiceSocket *sockopt = (ServiceSocket *)calloc(1, sizeof(ServiceSocket) + strlen(testSocName) + 1); ASSERT_NE(sockopt, nullptr); - sockopt->type = SOCK_SEQPACKET; + sockopt->type = SOCK_STREAM; + sockopt->protocol = 0; + sockopt->family = PF_UNIX; sockopt->sockFd = -1; sockopt->uid = 1000; sockopt->gid = 1000; diff --git a/test/unittest/param/watcher_agent_unittest.cpp b/test/unittest/param/watcher_agent_unittest.cpp index f470a518f..592db7f1b 100755 --- a/test/unittest/param/watcher_agent_unittest.cpp +++ b/test/unittest/param/watcher_agent_unittest.cpp @@ -23,6 +23,7 @@ #include "iwatcher_manager.h" #include "message_parcel.h" #include "param_utils.h" +#include "param_request.h" #include "sys_param.h" #include "system_ability_definition.h" #include "watcher.h" @@ -43,7 +44,14 @@ public: WatcherAgentUnitTest() {} virtual ~WatcherAgentUnitTest() {} - void SetUp() {} + void SetUp() + { + ParamWorkSpace *space = GetClientParamWorkSpace(); + if (space != nullptr && space->securityLabel != nullptr) { + space->securityLabel->cred.uid = 1000; // 1000 test uid + space->securityLabel->cred.gid = 1000; // 1000 test gid + } + } void TearDown() {} void TestBody() {} diff --git a/test/unittest/param/watcher_proxy_unittest.cpp b/test/unittest/param/watcher_proxy_unittest.cpp index 0f527338a..df7787f84 100755 --- a/test/unittest/param/watcher_proxy_unittest.cpp +++ b/test/unittest/param/watcher_proxy_unittest.cpp @@ -68,6 +68,7 @@ public: MessageParcel reply; MessageOption option; + data.WriteInterfaceToken(IWatcherManager::GetDescriptor()); data.WriteString(keyPrefix); sptr watcher = new TestWatcher(); bool ret = data.WriteRemoteObject(watcher->AsObject()); @@ -87,6 +88,7 @@ public: MessageParcel data; MessageParcel reply; MessageOption option; + data.WriteInterfaceToken(IWatcherManager::GetDescriptor()); data.WriteString(keyPrefix); data.WriteUint32(watcherId); watcherManager->OnRemoteRequest(IWatcherManager::DEL_WATCHER, data, reply, option); @@ -138,6 +140,8 @@ public: MessageParcel data; MessageParcel reply; MessageOption option; + + data.WriteInterfaceToken(IWatcherManager::GetDescriptor()); data.WriteString(keyPrefix); sptr watcher = new TestWatcher(); bool ret = data.WriteRemoteObject(watcher->AsObject()); From 4be544900fa5b318c6573c73a6130f3dfbb0c850 Mon Sep 17 00:00:00 2001 From: handyohos Date: Tue, 22 Mar 2022 19:33:29 +0800 Subject: [PATCH 16/29] bugfix: add sys_prod path to system-sandbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1)把sys_prod目录添加到system-sandbox沙盒中。 Signed-off-by: handyohos Change-Id: If6abc8c581491962eb462d6eb94609b3b0688af6 --- interfaces/innerkits/sandbox/system-sandbox.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/sandbox/system-sandbox.json b/interfaces/innerkits/sandbox/system-sandbox.json index 0a55be155..0af56aa20 100644 --- a/interfaces/innerkits/sandbox/system-sandbox.json +++ b/interfaces/innerkits/sandbox/system-sandbox.json @@ -56,6 +56,10 @@ "src-path" : "/storage", "sandbox-path" : "/storage", "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/sys_prod", + "sandbox-path" : "/sys_prod", + "sandbox-flags" : [ "bind", "rec", "private" ] } ], "mount-bind-files" : [{ @@ -71,4 +75,4 @@ "link-name" : "/etc" } ] -} \ No newline at end of file +} From bf2effd104520e7424dcc276c0e91ff8a8205f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BA=91=E5=B3=B0?= Date: Wed, 23 Mar 2022 03:46:53 +0000 Subject: [PATCH 17/29] update services/etc/param/ohos.para.#I4Z2GI Signed-off-by: heitubaibu --- services/etc/param/ohos.para | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/etc/param/ohos.para b/services/etc/param/ohos.para index 751985d57..5565bf768 100755 --- a/services/etc/param/ohos.para +++ b/services/etc/param/ohos.para @@ -55,7 +55,7 @@ const.product.bootloader.version=bootloader # OHOS_ABI_LIST[] = {"default"} const.product.cpu.abilist=default # OHOS_SECURITY_PATCH_TAG[] = { "2020-09-01" } -const.ohos.version.security_patch=2020-09-01 +const.ohos.version.security_patch=2022-03-30 # OHOS_DISPLAY_VERSION[] = {"OpenHarmony 3.1.5.2"} const.product.software.version=OpenHarmony 3.1.5.2 # OHOS_INCREMENTAL_VERSION[] = {"default"} From 3f770b82e7fe639e0f0f59bb4ea38945f7b58eb8 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Wed, 23 Mar 2022 15:01:33 +0800 Subject: [PATCH 18/29] fix: source code file mode Signed-off-by: xionglei6 --- device_info/BUILD.gn | 0 device_info/device_info_kits.cpp | 0 device_info/device_info_kits.h | 0 device_info/device_info_proxy.cpp | 0 device_info/device_info_proxy.h | 0 device_info/device_info_stub.cpp | 0 device_info/device_info_stub.h | 0 device_info/idevice_info.h | 0 interfaces/innerkits/BUILD.gn | 0 interfaces/innerkits/include/fs_manager/fs_manager.h | 0 interfaces/innerkits/include/init_file.h | 0 interfaces/innerkits/include/init_plugin.h | 0 interfaces/innerkits/include/init_reboot.h | 0 interfaces/innerkits/include/init_socket.h | 0 interfaces/innerkits/plugin/BUILD.gn | 0 interfaces/innerkits/sandbox/BUILD.gn | 0 interfaces/kits/BUILD.gn | 0 interfaces/kits/include/syscap_ndk.h | 0 interfaces/kits/init_sync.h | 0 services/BUILD.gn | 0 services/begetctl/BUILD.gn | 0 services/begetctl/begetctl.h | 0 services/begetctl/misc_daemon.cpp | 0 services/begetctl/sandbox.cpp | 0 services/begetctl/shell/shell.h | 0 services/begetctl/shell/shell_bas.h | 0 services/begetctl/shell/shell_utils.h | 0 services/include/init_hashmap.h | 0 services/include/init_utils.h | 0 services/include/list.h | 0 services/include/param/init_param.h | 0 services/include/param/param.h | 0 services/include/param/sys_param.h | 0 services/include/switch_root.h | 0 services/init/include/device.h | 0 services/init/include/init.h | 0 services/init/include/init_adapter.h | 0 services/init/include/init_cmds.h | 0 services/init/include/init_group_manager.h | 0 services/init/include/init_jobs_internal.h | 0 services/init/include/init_plugin_manager.h | 0 services/init/include/init_service.h | 0 services/init/include/init_service_file.h | 0 services/init/include/init_service_manager.h | 0 services/init/include/init_service_socket.h | 0 services/init/standard/init_mount.h | 0 services/log/BUILD.gn | 0 services/log/init_log.h | 0 services/loopevent/BUILD.gn | 0 services/loopevent/include/loop_event.h | 0 services/loopevent/loop/le_epoll.h | 0 services/loopevent/loop/le_loop.h | 0 services/loopevent/signal/le_signal.h | 0 services/loopevent/socket/le_socket.h | 0 services/loopevent/task/le_task.h | 0 services/loopevent/timer/le_timer.h | 0 services/loopevent/utils/le_utils.h | 0 services/param/BUILD.gn | 0 services/param/include/param_manager.h | 0 services/param/include/param_message.h | 0 services/param/include/param_persist.h | 0 services/param/include/param_request.h | 0 services/param/include/param_security.h | 0 services/param/include/param_service.h | 0 services/param/include/param_trie.h | 0 services/param/include/param_utils.h | 0 services/param/include/trigger_checker.h | 0 services/param/include/trigger_manager.h | 0 services/param/watcher/agent/watcher.cpp | 0 services/param/watcher/agent/watcher.h | 0 services/param/watcher/agent/watcher_manager_kits.cpp | 0 services/param/watcher/agent/watcher_manager_kits.h | 0 services/param/watcher/agent/watcher_manager_proxy.cpp | 0 services/param/watcher/agent/watcher_manager_proxy.h | 0 services/param/watcher/agent/watcher_stub.cpp | 0 services/param/watcher/agent/watcher_stub.h | 0 services/param/watcher/include/iwatcher.h | 0 services/param/watcher/include/iwatcher_manager.h | 0 services/param/watcher/include/watcher_utils.h | 0 services/param/watcher/proxy/watcher_manager.cpp | 0 services/param/watcher/proxy/watcher_manager.h | 0 services/param/watcher/proxy/watcher_manager_stub.cpp | 0 services/param/watcher/proxy/watcher_manager_stub.h | 0 services/param/watcher/proxy/watcher_proxy.cpp | 0 services/param/watcher/proxy/watcher_proxy.h | 0 services/param/watcher/sa_profile/BUILD.gn | 0 services/plugin/BUILD.gn | 0 services/plugin/bootchart/bootchart.h | 0 services/plugin/plugin_adapter.h | 0 services/utils/BUILD.gn | 0 test/plugintest/BUILD.gn | 0 test/plugintest/plugin_test.h | 0 test/unittest/BUILD.gn | 0 test/unittest/common/BUILD.gn | 0 test/unittest/common/cmd_func_test.cpp | 0 test/unittest/init/cmds_unittest.cpp | 0 test/unittest/init/group_unittest.cpp | 0 test/unittest/init/init_reboot_unittest.cpp | 0 test/unittest/init/mount_unittest.cpp | 0 test/unittest/init/plugin_unittest.cpp | 0 test/unittest/init/service_file_unittest.cpp | 0 test/unittest/init/service_socket_unittest.cpp | 0 test/unittest/init/service_unittest.cpp | 0 test/unittest/init/utils_unittest.cpp | 0 test/unittest/init_unittest.h | 0 test/unittest/innerkits/innerkits_unittest.cpp | 0 test/unittest/param/client_unittest.cpp | 0 test/unittest/param/dac_unittest.cpp | 0 test/unittest/param/param_stub.h | 0 test/unittest/param/param_unittest.cpp | 0 test/unittest/param/selinux_unittest.cpp | 0 test/unittest/param/trigger_unittest.cpp | 0 test/unittest/param/watcher_agent_unittest.cpp | 0 test/unittest/param/watcher_proxy_unittest.cpp | 0 test/unittest/ueventd/ueventd_config_unittest.cpp | 0 ueventd/BUILD.gn | 0 ueventd/include/ueventd.h | 0 ueventd/include/ueventd_device_handler.h | 0 ueventd/include/ueventd_firmware_handler.h | 0 ueventd/include/ueventd_read_cfg.h | 0 ueventd/include/ueventd_socket.h | 0 ueventd/include/ueventd_utils.h | 0 watchdog/BUILD.gn | 0 123 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 device_info/BUILD.gn mode change 100755 => 100644 device_info/device_info_kits.cpp mode change 100755 => 100644 device_info/device_info_kits.h mode change 100755 => 100644 device_info/device_info_proxy.cpp mode change 100755 => 100644 device_info/device_info_proxy.h mode change 100755 => 100644 device_info/device_info_stub.cpp mode change 100755 => 100644 device_info/device_info_stub.h mode change 100755 => 100644 device_info/idevice_info.h mode change 100755 => 100644 interfaces/innerkits/BUILD.gn mode change 100755 => 100644 interfaces/innerkits/include/fs_manager/fs_manager.h mode change 100755 => 100644 interfaces/innerkits/include/init_file.h mode change 100755 => 100644 interfaces/innerkits/include/init_plugin.h mode change 100755 => 100644 interfaces/innerkits/include/init_reboot.h mode change 100755 => 100644 interfaces/innerkits/include/init_socket.h mode change 100755 => 100644 interfaces/innerkits/plugin/BUILD.gn mode change 100755 => 100644 interfaces/innerkits/sandbox/BUILD.gn mode change 100755 => 100644 interfaces/kits/BUILD.gn mode change 100755 => 100644 interfaces/kits/include/syscap_ndk.h mode change 100755 => 100644 interfaces/kits/init_sync.h mode change 100755 => 100644 services/BUILD.gn mode change 100755 => 100644 services/begetctl/BUILD.gn mode change 100755 => 100644 services/begetctl/begetctl.h mode change 100755 => 100644 services/begetctl/misc_daemon.cpp mode change 100755 => 100644 services/begetctl/sandbox.cpp mode change 100755 => 100644 services/begetctl/shell/shell.h mode change 100755 => 100644 services/begetctl/shell/shell_bas.h mode change 100755 => 100644 services/begetctl/shell/shell_utils.h mode change 100755 => 100644 services/include/init_hashmap.h mode change 100755 => 100644 services/include/init_utils.h mode change 100755 => 100644 services/include/list.h mode change 100755 => 100644 services/include/param/init_param.h mode change 100755 => 100644 services/include/param/param.h mode change 100755 => 100644 services/include/param/sys_param.h mode change 100755 => 100644 services/include/switch_root.h mode change 100755 => 100644 services/init/include/device.h mode change 100755 => 100644 services/init/include/init.h mode change 100755 => 100644 services/init/include/init_adapter.h mode change 100755 => 100644 services/init/include/init_cmds.h mode change 100755 => 100644 services/init/include/init_group_manager.h mode change 100755 => 100644 services/init/include/init_jobs_internal.h mode change 100755 => 100644 services/init/include/init_plugin_manager.h mode change 100755 => 100644 services/init/include/init_service.h mode change 100755 => 100644 services/init/include/init_service_file.h mode change 100755 => 100644 services/init/include/init_service_manager.h mode change 100755 => 100644 services/init/include/init_service_socket.h mode change 100755 => 100644 services/init/standard/init_mount.h mode change 100755 => 100644 services/log/BUILD.gn mode change 100755 => 100644 services/log/init_log.h mode change 100755 => 100644 services/loopevent/BUILD.gn mode change 100755 => 100644 services/loopevent/include/loop_event.h mode change 100755 => 100644 services/loopevent/loop/le_epoll.h mode change 100755 => 100644 services/loopevent/loop/le_loop.h mode change 100755 => 100644 services/loopevent/signal/le_signal.h mode change 100755 => 100644 services/loopevent/socket/le_socket.h mode change 100755 => 100644 services/loopevent/task/le_task.h mode change 100755 => 100644 services/loopevent/timer/le_timer.h mode change 100755 => 100644 services/loopevent/utils/le_utils.h mode change 100755 => 100644 services/param/BUILD.gn mode change 100755 => 100644 services/param/include/param_manager.h mode change 100755 => 100644 services/param/include/param_message.h mode change 100755 => 100644 services/param/include/param_persist.h mode change 100755 => 100644 services/param/include/param_request.h mode change 100755 => 100644 services/param/include/param_security.h mode change 100755 => 100644 services/param/include/param_service.h mode change 100755 => 100644 services/param/include/param_trie.h mode change 100755 => 100644 services/param/include/param_utils.h mode change 100755 => 100644 services/param/include/trigger_checker.h mode change 100755 => 100644 services/param/include/trigger_manager.h mode change 100755 => 100644 services/param/watcher/agent/watcher.cpp mode change 100755 => 100644 services/param/watcher/agent/watcher.h mode change 100755 => 100644 services/param/watcher/agent/watcher_manager_kits.cpp mode change 100755 => 100644 services/param/watcher/agent/watcher_manager_kits.h mode change 100755 => 100644 services/param/watcher/agent/watcher_manager_proxy.cpp mode change 100755 => 100644 services/param/watcher/agent/watcher_manager_proxy.h mode change 100755 => 100644 services/param/watcher/agent/watcher_stub.cpp mode change 100755 => 100644 services/param/watcher/agent/watcher_stub.h mode change 100755 => 100644 services/param/watcher/include/iwatcher.h mode change 100755 => 100644 services/param/watcher/include/iwatcher_manager.h mode change 100755 => 100644 services/param/watcher/include/watcher_utils.h mode change 100755 => 100644 services/param/watcher/proxy/watcher_manager.cpp mode change 100755 => 100644 services/param/watcher/proxy/watcher_manager.h mode change 100755 => 100644 services/param/watcher/proxy/watcher_manager_stub.cpp mode change 100755 => 100644 services/param/watcher/proxy/watcher_manager_stub.h mode change 100755 => 100644 services/param/watcher/proxy/watcher_proxy.cpp mode change 100755 => 100644 services/param/watcher/proxy/watcher_proxy.h mode change 100755 => 100644 services/param/watcher/sa_profile/BUILD.gn mode change 100755 => 100644 services/plugin/BUILD.gn mode change 100755 => 100644 services/plugin/bootchart/bootchart.h mode change 100755 => 100644 services/plugin/plugin_adapter.h mode change 100755 => 100644 services/utils/BUILD.gn mode change 100755 => 100644 test/plugintest/BUILD.gn mode change 100755 => 100644 test/plugintest/plugin_test.h mode change 100755 => 100644 test/unittest/BUILD.gn mode change 100755 => 100644 test/unittest/common/BUILD.gn mode change 100755 => 100644 test/unittest/common/cmd_func_test.cpp mode change 100755 => 100644 test/unittest/init/cmds_unittest.cpp mode change 100755 => 100644 test/unittest/init/group_unittest.cpp mode change 100755 => 100644 test/unittest/init/init_reboot_unittest.cpp mode change 100755 => 100644 test/unittest/init/mount_unittest.cpp mode change 100755 => 100644 test/unittest/init/plugin_unittest.cpp mode change 100755 => 100644 test/unittest/init/service_file_unittest.cpp mode change 100755 => 100644 test/unittest/init/service_socket_unittest.cpp mode change 100755 => 100644 test/unittest/init/service_unittest.cpp mode change 100755 => 100644 test/unittest/init/utils_unittest.cpp mode change 100755 => 100644 test/unittest/init_unittest.h mode change 100755 => 100644 test/unittest/innerkits/innerkits_unittest.cpp mode change 100755 => 100644 test/unittest/param/client_unittest.cpp mode change 100755 => 100644 test/unittest/param/dac_unittest.cpp mode change 100755 => 100644 test/unittest/param/param_stub.h mode change 100755 => 100644 test/unittest/param/param_unittest.cpp mode change 100755 => 100644 test/unittest/param/selinux_unittest.cpp mode change 100755 => 100644 test/unittest/param/trigger_unittest.cpp mode change 100755 => 100644 test/unittest/param/watcher_agent_unittest.cpp mode change 100755 => 100644 test/unittest/param/watcher_proxy_unittest.cpp mode change 100755 => 100644 test/unittest/ueventd/ueventd_config_unittest.cpp mode change 100755 => 100644 ueventd/BUILD.gn mode change 100755 => 100644 ueventd/include/ueventd.h mode change 100755 => 100644 ueventd/include/ueventd_device_handler.h mode change 100755 => 100644 ueventd/include/ueventd_firmware_handler.h mode change 100755 => 100644 ueventd/include/ueventd_read_cfg.h mode change 100755 => 100644 ueventd/include/ueventd_socket.h mode change 100755 => 100644 ueventd/include/ueventd_utils.h mode change 100755 => 100644 watchdog/BUILD.gn diff --git a/device_info/BUILD.gn b/device_info/BUILD.gn old mode 100755 new mode 100644 diff --git a/device_info/device_info_kits.cpp b/device_info/device_info_kits.cpp old mode 100755 new mode 100644 diff --git a/device_info/device_info_kits.h b/device_info/device_info_kits.h old mode 100755 new mode 100644 diff --git a/device_info/device_info_proxy.cpp b/device_info/device_info_proxy.cpp old mode 100755 new mode 100644 diff --git a/device_info/device_info_proxy.h b/device_info/device_info_proxy.h old mode 100755 new mode 100644 diff --git a/device_info/device_info_stub.cpp b/device_info/device_info_stub.cpp old mode 100755 new mode 100644 diff --git a/device_info/device_info_stub.h b/device_info/device_info_stub.h old mode 100755 new mode 100644 diff --git a/device_info/idevice_info.h b/device_info/idevice_info.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/fs_manager/fs_manager.h b/interfaces/innerkits/include/fs_manager/fs_manager.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/init_file.h b/interfaces/innerkits/include/init_file.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/init_plugin.h b/interfaces/innerkits/include/init_plugin.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/init_reboot.h b/interfaces/innerkits/include/init_reboot.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/include/init_socket.h b/interfaces/innerkits/include/init_socket.h old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/plugin/BUILD.gn b/interfaces/innerkits/plugin/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/sandbox/BUILD.gn b/interfaces/innerkits/sandbox/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/kits/BUILD.gn b/interfaces/kits/BUILD.gn old mode 100755 new mode 100644 diff --git a/interfaces/kits/include/syscap_ndk.h b/interfaces/kits/include/syscap_ndk.h old mode 100755 new mode 100644 diff --git a/interfaces/kits/init_sync.h b/interfaces/kits/init_sync.h old mode 100755 new mode 100644 diff --git a/services/BUILD.gn b/services/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/begetctl/BUILD.gn b/services/begetctl/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/begetctl/begetctl.h b/services/begetctl/begetctl.h old mode 100755 new mode 100644 diff --git a/services/begetctl/misc_daemon.cpp b/services/begetctl/misc_daemon.cpp old mode 100755 new mode 100644 diff --git a/services/begetctl/sandbox.cpp b/services/begetctl/sandbox.cpp old mode 100755 new mode 100644 diff --git a/services/begetctl/shell/shell.h b/services/begetctl/shell/shell.h old mode 100755 new mode 100644 diff --git a/services/begetctl/shell/shell_bas.h b/services/begetctl/shell/shell_bas.h old mode 100755 new mode 100644 diff --git a/services/begetctl/shell/shell_utils.h b/services/begetctl/shell/shell_utils.h old mode 100755 new mode 100644 diff --git a/services/include/init_hashmap.h b/services/include/init_hashmap.h old mode 100755 new mode 100644 diff --git a/services/include/init_utils.h b/services/include/init_utils.h old mode 100755 new mode 100644 diff --git a/services/include/list.h b/services/include/list.h old mode 100755 new mode 100644 diff --git a/services/include/param/init_param.h b/services/include/param/init_param.h old mode 100755 new mode 100644 diff --git a/services/include/param/param.h b/services/include/param/param.h old mode 100755 new mode 100644 diff --git a/services/include/param/sys_param.h b/services/include/param/sys_param.h old mode 100755 new mode 100644 diff --git a/services/include/switch_root.h b/services/include/switch_root.h old mode 100755 new mode 100644 diff --git a/services/init/include/device.h b/services/init/include/device.h old mode 100755 new mode 100644 diff --git a/services/init/include/init.h b/services/init/include/init.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_adapter.h b/services/init/include/init_adapter.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_cmds.h b/services/init/include/init_cmds.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_group_manager.h b/services/init/include/init_group_manager.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_jobs_internal.h b/services/init/include/init_jobs_internal.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_plugin_manager.h b/services/init/include/init_plugin_manager.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_service.h b/services/init/include/init_service.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_service_file.h b/services/init/include/init_service_file.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_service_manager.h b/services/init/include/init_service_manager.h old mode 100755 new mode 100644 diff --git a/services/init/include/init_service_socket.h b/services/init/include/init_service_socket.h old mode 100755 new mode 100644 diff --git a/services/init/standard/init_mount.h b/services/init/standard/init_mount.h old mode 100755 new mode 100644 diff --git a/services/log/BUILD.gn b/services/log/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/log/init_log.h b/services/log/init_log.h old mode 100755 new mode 100644 diff --git a/services/loopevent/BUILD.gn b/services/loopevent/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/loopevent/include/loop_event.h b/services/loopevent/include/loop_event.h old mode 100755 new mode 100644 diff --git a/services/loopevent/loop/le_epoll.h b/services/loopevent/loop/le_epoll.h old mode 100755 new mode 100644 diff --git a/services/loopevent/loop/le_loop.h b/services/loopevent/loop/le_loop.h old mode 100755 new mode 100644 diff --git a/services/loopevent/signal/le_signal.h b/services/loopevent/signal/le_signal.h old mode 100755 new mode 100644 diff --git a/services/loopevent/socket/le_socket.h b/services/loopevent/socket/le_socket.h old mode 100755 new mode 100644 diff --git a/services/loopevent/task/le_task.h b/services/loopevent/task/le_task.h old mode 100755 new mode 100644 diff --git a/services/loopevent/timer/le_timer.h b/services/loopevent/timer/le_timer.h old mode 100755 new mode 100644 diff --git a/services/loopevent/utils/le_utils.h b/services/loopevent/utils/le_utils.h old mode 100755 new mode 100644 diff --git a/services/param/BUILD.gn b/services/param/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/param/include/param_manager.h b/services/param/include/param_manager.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_message.h b/services/param/include/param_message.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_persist.h b/services/param/include/param_persist.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_request.h b/services/param/include/param_request.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_security.h b/services/param/include/param_security.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_service.h b/services/param/include/param_service.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_trie.h b/services/param/include/param_trie.h old mode 100755 new mode 100644 diff --git a/services/param/include/param_utils.h b/services/param/include/param_utils.h old mode 100755 new mode 100644 diff --git a/services/param/include/trigger_checker.h b/services/param/include/trigger_checker.h old mode 100755 new mode 100644 diff --git a/services/param/include/trigger_manager.h b/services/param/include/trigger_manager.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher.cpp b/services/param/watcher/agent/watcher.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher.h b/services/param/watcher/agent/watcher.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_manager_kits.cpp b/services/param/watcher/agent/watcher_manager_kits.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_manager_kits.h b/services/param/watcher/agent/watcher_manager_kits.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_manager_proxy.cpp b/services/param/watcher/agent/watcher_manager_proxy.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_manager_proxy.h b/services/param/watcher/agent/watcher_manager_proxy.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_stub.cpp b/services/param/watcher/agent/watcher_stub.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/agent/watcher_stub.h b/services/param/watcher/agent/watcher_stub.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/include/iwatcher.h b/services/param/watcher/include/iwatcher.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/include/iwatcher_manager.h b/services/param/watcher/include/iwatcher_manager.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/include/watcher_utils.h b/services/param/watcher/include/watcher_utils.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_manager.cpp b/services/param/watcher/proxy/watcher_manager.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_manager.h b/services/param/watcher/proxy/watcher_manager.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_manager_stub.cpp b/services/param/watcher/proxy/watcher_manager_stub.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_manager_stub.h b/services/param/watcher/proxy/watcher_manager_stub.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_proxy.cpp b/services/param/watcher/proxy/watcher_proxy.cpp old mode 100755 new mode 100644 diff --git a/services/param/watcher/proxy/watcher_proxy.h b/services/param/watcher/proxy/watcher_proxy.h old mode 100755 new mode 100644 diff --git a/services/param/watcher/sa_profile/BUILD.gn b/services/param/watcher/sa_profile/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/plugin/BUILD.gn b/services/plugin/BUILD.gn old mode 100755 new mode 100644 diff --git a/services/plugin/bootchart/bootchart.h b/services/plugin/bootchart/bootchart.h old mode 100755 new mode 100644 diff --git a/services/plugin/plugin_adapter.h b/services/plugin/plugin_adapter.h old mode 100755 new mode 100644 diff --git a/services/utils/BUILD.gn b/services/utils/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/plugintest/BUILD.gn b/test/plugintest/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/plugintest/plugin_test.h b/test/plugintest/plugin_test.h old mode 100755 new mode 100644 diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/unittest/common/BUILD.gn b/test/unittest/common/BUILD.gn old mode 100755 new mode 100644 diff --git a/test/unittest/common/cmd_func_test.cpp b/test/unittest/common/cmd_func_test.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/cmds_unittest.cpp b/test/unittest/init/cmds_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/group_unittest.cpp b/test/unittest/init/group_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/init_reboot_unittest.cpp b/test/unittest/init/init_reboot_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/mount_unittest.cpp b/test/unittest/init/mount_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/plugin_unittest.cpp b/test/unittest/init/plugin_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/service_file_unittest.cpp b/test/unittest/init/service_file_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/service_socket_unittest.cpp b/test/unittest/init/service_socket_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/service_unittest.cpp b/test/unittest/init/service_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init/utils_unittest.cpp b/test/unittest/init/utils_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/init_unittest.h b/test/unittest/init_unittest.h old mode 100755 new mode 100644 diff --git a/test/unittest/innerkits/innerkits_unittest.cpp b/test/unittest/innerkits/innerkits_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/client_unittest.cpp b/test/unittest/param/client_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/dac_unittest.cpp b/test/unittest/param/dac_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/param_stub.h b/test/unittest/param/param_stub.h old mode 100755 new mode 100644 diff --git a/test/unittest/param/param_unittest.cpp b/test/unittest/param/param_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/selinux_unittest.cpp b/test/unittest/param/selinux_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/trigger_unittest.cpp b/test/unittest/param/trigger_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/watcher_agent_unittest.cpp b/test/unittest/param/watcher_agent_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/param/watcher_proxy_unittest.cpp b/test/unittest/param/watcher_proxy_unittest.cpp old mode 100755 new mode 100644 diff --git a/test/unittest/ueventd/ueventd_config_unittest.cpp b/test/unittest/ueventd/ueventd_config_unittest.cpp old mode 100755 new mode 100644 diff --git a/ueventd/BUILD.gn b/ueventd/BUILD.gn old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd.h b/ueventd/include/ueventd.h old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd_device_handler.h b/ueventd/include/ueventd_device_handler.h old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd_firmware_handler.h b/ueventd/include/ueventd_firmware_handler.h old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd_read_cfg.h b/ueventd/include/ueventd_read_cfg.h old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd_socket.h b/ueventd/include/ueventd_socket.h old mode 100755 new mode 100644 diff --git a/ueventd/include/ueventd_utils.h b/ueventd/include/ueventd_utils.h old mode 100755 new mode 100644 diff --git a/watchdog/BUILD.gn b/watchdog/BUILD.gn old mode 100755 new mode 100644 From 968afd6d0ce267a841cd5c638b3cd5dfc1858399 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Wed, 23 Mar 2022 15:33:39 +0800 Subject: [PATCH 19/29] fix: source code file mode Signed-off-by: xionglei6 --- interfaces/innerkits/file/init_file.c | 0 interfaces/innerkits/fs_manager/fstab.c | 0 interfaces/innerkits/plugin/init_plugin.c | 0 interfaces/innerkits/reboot/init_reboot_innerkits.c | 0 interfaces/innerkits/socket/init_socket.c | 0 services/begetctl/bootchart_cmd.c | 0 services/begetctl/init_cmd_reboot.c | 0 services/begetctl/main.c | 0 services/begetctl/param_cmd.c | 0 services/begetctl/service_control.c | 0 services/begetctl/shell/shell_bas.c | 0 services/begetctl/shell/shell_main.c | 0 services/init/adapter/init_adapter.c | 0 services/init/init_capability.c | 0 services/init/init_common_cmds.c | 0 services/init/init_common_service.c | 0 services/init/init_config.c | 0 services/init/init_group_manager.c | 0 services/init/init_service_file.c | 0 services/init/init_service_manager.c | 0 services/init/init_service_socket.c | 0 services/init/lite/init.c | 0 services/init/lite/init_cmds.c | 0 services/init/lite/init_jobs.c | 0 services/init/lite/init_reboot.c | 0 services/init/lite/init_service.c | 0 services/init/lite/init_signal_handler.c | 0 services/init/main.c | 0 services/init/standard/device.c | 0 services/init/standard/init.c | 0 services/init/standard/init_cmds.c | 0 services/init/standard/init_jobs.c | 0 services/init/standard/init_mount.c | 0 services/init/standard/init_plugin_manager.c | 0 services/init/standard/init_reboot.c | 0 services/init/standard/init_service.c | 0 services/init/standard/init_signal_handler.c | 0 services/init/standard/switch_root.c | 0 services/log/init_log.c | 0 services/loopevent/loop/le_epoll.c | 0 services/loopevent/loop/le_loop.c | 0 services/loopevent/signal/le_signal.c | 0 services/loopevent/socket/le_socket.c | 0 services/loopevent/task/le_asynctask.c | 0 services/loopevent/task/le_streamtask.c | 0 services/loopevent/task/le_task.c | 0 services/loopevent/task/le_watchtask.c | 0 services/loopevent/timer/le_timer.c | 0 services/loopevent/utils/le_utils.c | 0 services/param/adapter/param_dac.c | 0 services/param/adapter/param_libuvadp.c | 0 services/param/adapter/param_persistadp.c | 0 services/param/adapter/param_selinux.c | 0 services/param/client/param_request.c | 0 services/param/manager/param_manager.c | 0 services/param/manager/param_message.c | 0 services/param/manager/param_trie.c | 0 services/param/manager/param_utils.c | 0 services/param/service/param_persist.c | 0 services/param/service/param_service.c | 0 services/param/trigger/trigger_checker.c | 0 services/param/trigger/trigger_manager.c | 0 services/param/trigger/trigger_processor.c | 0 services/plugin/bootchart/bootchart.c | 0 services/utils/init_hashmap.c | 0 services/utils/init_utils.c | 0 services/utils/list.c | 0 test/plugintest/plugin_param_cmd.c | 0 test/plugintest/plugin_param_test.c | 0 ueventd/ueventd.c | 0 ueventd/ueventd_device_handler.c | 0 ueventd/ueventd_firmware_handler.c | 0 ueventd/ueventd_main.c | 0 ueventd/ueventd_read_cfg.c | 0 ueventd/ueventd_socket.c | 0 watchdog/init_watchdog.c | 0 76 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 interfaces/innerkits/file/init_file.c mode change 100755 => 100644 interfaces/innerkits/fs_manager/fstab.c mode change 100755 => 100644 interfaces/innerkits/plugin/init_plugin.c mode change 100755 => 100644 interfaces/innerkits/reboot/init_reboot_innerkits.c mode change 100755 => 100644 interfaces/innerkits/socket/init_socket.c mode change 100755 => 100644 services/begetctl/bootchart_cmd.c mode change 100755 => 100644 services/begetctl/init_cmd_reboot.c mode change 100755 => 100644 services/begetctl/main.c mode change 100755 => 100644 services/begetctl/param_cmd.c mode change 100755 => 100644 services/begetctl/service_control.c mode change 100755 => 100644 services/begetctl/shell/shell_bas.c mode change 100755 => 100644 services/begetctl/shell/shell_main.c mode change 100755 => 100644 services/init/adapter/init_adapter.c mode change 100755 => 100644 services/init/init_capability.c mode change 100755 => 100644 services/init/init_common_cmds.c mode change 100755 => 100644 services/init/init_common_service.c mode change 100755 => 100644 services/init/init_config.c mode change 100755 => 100644 services/init/init_group_manager.c mode change 100755 => 100644 services/init/init_service_file.c mode change 100755 => 100644 services/init/init_service_manager.c mode change 100755 => 100644 services/init/init_service_socket.c mode change 100755 => 100644 services/init/lite/init.c mode change 100755 => 100644 services/init/lite/init_cmds.c mode change 100755 => 100644 services/init/lite/init_jobs.c mode change 100755 => 100644 services/init/lite/init_reboot.c mode change 100755 => 100644 services/init/lite/init_service.c mode change 100755 => 100644 services/init/lite/init_signal_handler.c mode change 100755 => 100644 services/init/main.c mode change 100755 => 100644 services/init/standard/device.c mode change 100755 => 100644 services/init/standard/init.c mode change 100755 => 100644 services/init/standard/init_cmds.c mode change 100755 => 100644 services/init/standard/init_jobs.c mode change 100755 => 100644 services/init/standard/init_mount.c mode change 100755 => 100644 services/init/standard/init_plugin_manager.c mode change 100755 => 100644 services/init/standard/init_reboot.c mode change 100755 => 100644 services/init/standard/init_service.c mode change 100755 => 100644 services/init/standard/init_signal_handler.c mode change 100755 => 100644 services/init/standard/switch_root.c mode change 100755 => 100644 services/log/init_log.c mode change 100755 => 100644 services/loopevent/loop/le_epoll.c mode change 100755 => 100644 services/loopevent/loop/le_loop.c mode change 100755 => 100644 services/loopevent/signal/le_signal.c mode change 100755 => 100644 services/loopevent/socket/le_socket.c mode change 100755 => 100644 services/loopevent/task/le_asynctask.c mode change 100755 => 100644 services/loopevent/task/le_streamtask.c mode change 100755 => 100644 services/loopevent/task/le_task.c mode change 100755 => 100644 services/loopevent/task/le_watchtask.c mode change 100755 => 100644 services/loopevent/timer/le_timer.c mode change 100755 => 100644 services/loopevent/utils/le_utils.c mode change 100755 => 100644 services/param/adapter/param_dac.c mode change 100755 => 100644 services/param/adapter/param_libuvadp.c mode change 100755 => 100644 services/param/adapter/param_persistadp.c mode change 100755 => 100644 services/param/adapter/param_selinux.c mode change 100755 => 100644 services/param/client/param_request.c mode change 100755 => 100644 services/param/manager/param_manager.c mode change 100755 => 100644 services/param/manager/param_message.c mode change 100755 => 100644 services/param/manager/param_trie.c mode change 100755 => 100644 services/param/manager/param_utils.c mode change 100755 => 100644 services/param/service/param_persist.c mode change 100755 => 100644 services/param/service/param_service.c mode change 100755 => 100644 services/param/trigger/trigger_checker.c mode change 100755 => 100644 services/param/trigger/trigger_manager.c mode change 100755 => 100644 services/param/trigger/trigger_processor.c mode change 100755 => 100644 services/plugin/bootchart/bootchart.c mode change 100755 => 100644 services/utils/init_hashmap.c mode change 100755 => 100644 services/utils/init_utils.c mode change 100755 => 100644 services/utils/list.c mode change 100755 => 100644 test/plugintest/plugin_param_cmd.c mode change 100755 => 100644 test/plugintest/plugin_param_test.c mode change 100755 => 100644 ueventd/ueventd.c mode change 100755 => 100644 ueventd/ueventd_device_handler.c mode change 100755 => 100644 ueventd/ueventd_firmware_handler.c mode change 100755 => 100644 ueventd/ueventd_main.c mode change 100755 => 100644 ueventd/ueventd_read_cfg.c mode change 100755 => 100644 ueventd/ueventd_socket.c mode change 100755 => 100644 watchdog/init_watchdog.c diff --git a/interfaces/innerkits/file/init_file.c b/interfaces/innerkits/file/init_file.c old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/fs_manager/fstab.c b/interfaces/innerkits/fs_manager/fstab.c old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/plugin/init_plugin.c b/interfaces/innerkits/plugin/init_plugin.c old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/reboot/init_reboot_innerkits.c b/interfaces/innerkits/reboot/init_reboot_innerkits.c old mode 100755 new mode 100644 diff --git a/interfaces/innerkits/socket/init_socket.c b/interfaces/innerkits/socket/init_socket.c old mode 100755 new mode 100644 diff --git a/services/begetctl/bootchart_cmd.c b/services/begetctl/bootchart_cmd.c old mode 100755 new mode 100644 diff --git a/services/begetctl/init_cmd_reboot.c b/services/begetctl/init_cmd_reboot.c old mode 100755 new mode 100644 diff --git a/services/begetctl/main.c b/services/begetctl/main.c old mode 100755 new mode 100644 diff --git a/services/begetctl/param_cmd.c b/services/begetctl/param_cmd.c old mode 100755 new mode 100644 diff --git a/services/begetctl/service_control.c b/services/begetctl/service_control.c old mode 100755 new mode 100644 diff --git a/services/begetctl/shell/shell_bas.c b/services/begetctl/shell/shell_bas.c old mode 100755 new mode 100644 diff --git a/services/begetctl/shell/shell_main.c b/services/begetctl/shell/shell_main.c old mode 100755 new mode 100644 diff --git a/services/init/adapter/init_adapter.c b/services/init/adapter/init_adapter.c old mode 100755 new mode 100644 diff --git a/services/init/init_capability.c b/services/init/init_capability.c old mode 100755 new mode 100644 diff --git a/services/init/init_common_cmds.c b/services/init/init_common_cmds.c old mode 100755 new mode 100644 diff --git a/services/init/init_common_service.c b/services/init/init_common_service.c old mode 100755 new mode 100644 diff --git a/services/init/init_config.c b/services/init/init_config.c old mode 100755 new mode 100644 diff --git a/services/init/init_group_manager.c b/services/init/init_group_manager.c old mode 100755 new mode 100644 diff --git a/services/init/init_service_file.c b/services/init/init_service_file.c old mode 100755 new mode 100644 diff --git a/services/init/init_service_manager.c b/services/init/init_service_manager.c old mode 100755 new mode 100644 diff --git a/services/init/init_service_socket.c b/services/init/init_service_socket.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init.c b/services/init/lite/init.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init_cmds.c b/services/init/lite/init_cmds.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init_jobs.c b/services/init/lite/init_jobs.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init_reboot.c b/services/init/lite/init_reboot.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init_service.c b/services/init/lite/init_service.c old mode 100755 new mode 100644 diff --git a/services/init/lite/init_signal_handler.c b/services/init/lite/init_signal_handler.c old mode 100755 new mode 100644 diff --git a/services/init/main.c b/services/init/main.c old mode 100755 new mode 100644 diff --git a/services/init/standard/device.c b/services/init/standard/device.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init.c b/services/init/standard/init.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_cmds.c b/services/init/standard/init_cmds.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_jobs.c b/services/init/standard/init_jobs.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_mount.c b/services/init/standard/init_mount.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_plugin_manager.c b/services/init/standard/init_plugin_manager.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_reboot.c b/services/init/standard/init_reboot.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_service.c b/services/init/standard/init_service.c old mode 100755 new mode 100644 diff --git a/services/init/standard/init_signal_handler.c b/services/init/standard/init_signal_handler.c old mode 100755 new mode 100644 diff --git a/services/init/standard/switch_root.c b/services/init/standard/switch_root.c old mode 100755 new mode 100644 diff --git a/services/log/init_log.c b/services/log/init_log.c old mode 100755 new mode 100644 diff --git a/services/loopevent/loop/le_epoll.c b/services/loopevent/loop/le_epoll.c old mode 100755 new mode 100644 diff --git a/services/loopevent/loop/le_loop.c b/services/loopevent/loop/le_loop.c old mode 100755 new mode 100644 diff --git a/services/loopevent/signal/le_signal.c b/services/loopevent/signal/le_signal.c old mode 100755 new mode 100644 diff --git a/services/loopevent/socket/le_socket.c b/services/loopevent/socket/le_socket.c old mode 100755 new mode 100644 diff --git a/services/loopevent/task/le_asynctask.c b/services/loopevent/task/le_asynctask.c old mode 100755 new mode 100644 diff --git a/services/loopevent/task/le_streamtask.c b/services/loopevent/task/le_streamtask.c old mode 100755 new mode 100644 diff --git a/services/loopevent/task/le_task.c b/services/loopevent/task/le_task.c old mode 100755 new mode 100644 diff --git a/services/loopevent/task/le_watchtask.c b/services/loopevent/task/le_watchtask.c old mode 100755 new mode 100644 diff --git a/services/loopevent/timer/le_timer.c b/services/loopevent/timer/le_timer.c old mode 100755 new mode 100644 diff --git a/services/loopevent/utils/le_utils.c b/services/loopevent/utils/le_utils.c old mode 100755 new mode 100644 diff --git a/services/param/adapter/param_dac.c b/services/param/adapter/param_dac.c old mode 100755 new mode 100644 diff --git a/services/param/adapter/param_libuvadp.c b/services/param/adapter/param_libuvadp.c old mode 100755 new mode 100644 diff --git a/services/param/adapter/param_persistadp.c b/services/param/adapter/param_persistadp.c old mode 100755 new mode 100644 diff --git a/services/param/adapter/param_selinux.c b/services/param/adapter/param_selinux.c old mode 100755 new mode 100644 diff --git a/services/param/client/param_request.c b/services/param/client/param_request.c old mode 100755 new mode 100644 diff --git a/services/param/manager/param_manager.c b/services/param/manager/param_manager.c old mode 100755 new mode 100644 diff --git a/services/param/manager/param_message.c b/services/param/manager/param_message.c old mode 100755 new mode 100644 diff --git a/services/param/manager/param_trie.c b/services/param/manager/param_trie.c old mode 100755 new mode 100644 diff --git a/services/param/manager/param_utils.c b/services/param/manager/param_utils.c old mode 100755 new mode 100644 diff --git a/services/param/service/param_persist.c b/services/param/service/param_persist.c old mode 100755 new mode 100644 diff --git a/services/param/service/param_service.c b/services/param/service/param_service.c old mode 100755 new mode 100644 diff --git a/services/param/trigger/trigger_checker.c b/services/param/trigger/trigger_checker.c old mode 100755 new mode 100644 diff --git a/services/param/trigger/trigger_manager.c b/services/param/trigger/trigger_manager.c old mode 100755 new mode 100644 diff --git a/services/param/trigger/trigger_processor.c b/services/param/trigger/trigger_processor.c old mode 100755 new mode 100644 diff --git a/services/plugin/bootchart/bootchart.c b/services/plugin/bootchart/bootchart.c old mode 100755 new mode 100644 diff --git a/services/utils/init_hashmap.c b/services/utils/init_hashmap.c old mode 100755 new mode 100644 diff --git a/services/utils/init_utils.c b/services/utils/init_utils.c old mode 100755 new mode 100644 diff --git a/services/utils/list.c b/services/utils/list.c old mode 100755 new mode 100644 diff --git a/test/plugintest/plugin_param_cmd.c b/test/plugintest/plugin_param_cmd.c old mode 100755 new mode 100644 diff --git a/test/plugintest/plugin_param_test.c b/test/plugintest/plugin_param_test.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd.c b/ueventd/ueventd.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd_device_handler.c b/ueventd/ueventd_device_handler.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd_firmware_handler.c b/ueventd/ueventd_firmware_handler.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd_main.c b/ueventd/ueventd_main.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd_read_cfg.c b/ueventd/ueventd_read_cfg.c old mode 100755 new mode 100644 diff --git a/ueventd/ueventd_socket.c b/ueventd/ueventd_socket.c old mode 100755 new mode 100644 diff --git a/watchdog/init_watchdog.c b/watchdog/init_watchdog.c old mode 100755 new mode 100644 From b1b6a655a4f021aa1182a2db7cf9151475f9ec90 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Thu, 24 Mar 2022 18:15:47 +0800 Subject: [PATCH 20/29] fix: korla review Signed-off-by: xionglei6 --- interfaces/innerkits/sandbox/sandbox.c | 2 +- services/begetctl/misc_daemon.cpp | 6 +++--- services/init/init_common_service.c | 2 +- services/init/init_group_manager.c | 3 ++- services/init/standard/fd_holder_service.c | 2 +- services/param/manager/param_manager.c | 8 +++++--- services/param/manager/param_utils.c | 3 ++- services/param/trigger/trigger_checker.c | 6 ++++-- services/param/trigger/trigger_manager.c | 6 ++++-- services/param/watcher/agent/watcher_manager_kits.cpp | 4 ++-- services/utils/init_utils.c | 3 ++- ueventd/ueventd_read_cfg.c | 3 --- 12 files changed, 27 insertions(+), 21 deletions(-) diff --git a/interfaces/innerkits/sandbox/sandbox.c b/interfaces/innerkits/sandbox/sandbox.c index 15aaf9c3b..02a51c514 100644 --- a/interfaces/innerkits/sandbox/sandbox.c +++ b/interfaces/innerkits/sandbox/sandbox.c @@ -298,7 +298,7 @@ static void InitSandbox(sandbox_t *sandbox, const char *sandboxConfig, const cha return; } if (sandbox->isCreated) { - BEGET_LOGE("Sandbox %s has created."); + BEGET_LOGE("Sandbox %s has created.", name); return; } if (UnshareNamespace(CLONE_NEWNS) < 0) { diff --git a/services/begetctl/misc_daemon.cpp b/services/begetctl/misc_daemon.cpp index 7453af362..749b5f8d9 100755 --- a/services/begetctl/misc_daemon.cpp +++ b/services/begetctl/misc_daemon.cpp @@ -81,13 +81,13 @@ static void WriteLogoContent(int fd, const std::string &logoPath, uint32_t size) (void)fclose(rgbFile); return; } - uint32_t ret = fread(buffer, 1, size, rgbFile); - if (ret < 0) { + (void)fread(buffer, 1, size, rgbFile); + if (ferror(rgbFile)) { (void)fclose(rgbFile); free(buffer); return; } - ret = write(fd, buffer, size); + uint32_t ret = write(fd, buffer, size); if (ret != size) { (void)fclose(rgbFile); free(buffer); diff --git a/services/init/init_common_service.c b/services/init/init_common_service.c index bdb7079f3..a93fd7fe1 100755 --- a/services/init/init_common_service.c +++ b/services/init/init_common_service.c @@ -570,7 +570,7 @@ static void ServiceTimerStartProcess(const TimerHandle handler, void *context) ServiceStopTimer(service); int ret = ServiceStart(service); if (ret != SERVICE_SUCCESS) { - INIT_LOGE("Start service \' %s \' in timer failed"); + INIT_LOGE("Start service \' %s \' in timer failed", service->name); } } diff --git a/services/init/init_group_manager.c b/services/init/init_group_manager.c index a2215e6cd..86f8ba93f 100755 --- a/services/init/init_group_manager.c +++ b/services/init/init_group_manager.c @@ -24,7 +24,8 @@ static InitWorkspace g_initWorkspace = {0, 0, {0}, {0}, {0}}; int GenerateHashCode(const char *key) { int code = 0; - for (size_t i = 0; i < strlen(key); i++) { + size_t keyLen = strlen(key); + for (size_t i = 0; i < keyLen; i++) { code += key[i] - 'A'; } return code; diff --git a/services/init/standard/fd_holder_service.c b/services/init/standard/fd_holder_service.c index 9f46a3ab9..2777521ac 100644 --- a/services/init/standard/fd_holder_service.c +++ b/services/init/standard/fd_holder_service.c @@ -134,7 +134,7 @@ static void HandlerGetFds(int sock, Service *service) } if (service->fds == NULL || service->fdCount == 0) { - INIT_LOGE("Service \' %s \' does not have any held fds"); + INIT_LOGE("Service \' %s \' does not have any held fds", service->name); errorInfo = "Service without any fds"; } diff --git a/services/param/manager/param_manager.c b/services/param/manager/param_manager.c index 8a5bcecb5..15db4f082 100755 --- a/services/param/manager/param_manager.c +++ b/services/param/manager/param_manager.c @@ -242,10 +242,12 @@ static int CheckParamPermissionWithSelinux(const ParamSecurityLabel *srcLabel, c { static void (*setSelinuxLogCallback)(); static int (*setParamCheck)(const char *paraName, struct ucred *uc); - g_selinuxHandle = dlopen("/system/lib/libparaperm_checker.z.so", RTLD_LAZY); if (g_selinuxHandle == NULL) { - PARAM_LOGE("Failed to dlopen libparaperm_checker.z.so, %s\n", dlerror()); - return DAC_RESULT_FORBIDED; + g_selinuxHandle = dlopen("/system/lib/libparaperm_checker.z.so", RTLD_LAZY); + if (g_selinuxHandle == NULL) { + PARAM_LOGE("Failed to dlopen libparaperm_checker.z.so, %s\n", dlerror()); + return DAC_RESULT_FORBIDED; + } } if (setSelinuxLogCallback == NULL) { setSelinuxLogCallback = (void (*)())dlsym(g_selinuxHandle, "SetSelinuxLogCallback"); diff --git a/services/param/manager/param_utils.c b/services/param/manager/param_utils.c index 617baa8af..7b17b5684 100755 --- a/services/param/manager/param_utils.c +++ b/services/param/manager/param_utils.c @@ -60,8 +60,9 @@ int GetSubStringInfo(const char *buff, uint32_t buffLen, char delimiter, SubStri { PARAM_CHECK(buff != NULL && info != NULL, return 0, "Invalid buff"); size_t i = 0; + size_t buffStrLen = strlen(buff); // 去掉开始的空格 - for (; i < strlen(buff); i++) { + for (; i < buffStrLen; i++) { if (!isspace(buff[i])) { break; } diff --git a/services/param/trigger/trigger_checker.c b/services/param/trigger/trigger_checker.c index bdf71a83c..cd7b29316 100755 --- a/services/param/trigger/trigger_checker.c +++ b/services/param/trigger/trigger_checker.c @@ -220,11 +220,12 @@ int ComputeCondition(LogicCalculator *calculator, const char *condition) PARAM_CHECK(calculator != NULL && condition != NULL, return -1, "Invalid calculator"); uint32_t currIndex = 0; uint32_t start = 0; + size_t conditionLen = strlen(condition); int noneOper = 1; CalculatorClear(calculator); LogicData data1 = {}; LogicData data2 = {}; - while (currIndex < strlen(condition)) { + while (currIndex < conditionLen) { if (condition[currIndex] == '|' || condition[currIndex] == '&') { noneOper = 0; int ret = CalculatorPop(calculator, (void*)&data2); @@ -274,10 +275,11 @@ int ConvertInfixToPrefix(const char *condition, char *prefix, uint32_t prefixLen int ret; uint32_t curr = 0; uint32_t prefixIndex = 0; + size_t conditionLen = strlen(condition); LogicCalculator calculator; CalculatorInit(&calculator, MAX_CALC_PARAM, 1, 0); - while (curr < strlen(condition)) { + while (curr < conditionLen) { if (condition[curr] == ')') { CalculatorPopChar(&calculator, &e); while (e != '(') { diff --git a/services/param/trigger/trigger_manager.c b/services/param/trigger/trigger_manager.c index f7bc8d3ab..06600aa46 100755 --- a/services/param/trigger/trigger_manager.c +++ b/services/param/trigger/trigger_manager.c @@ -595,7 +595,8 @@ static int JobNodeGetNodeHasCode(const HashNode *node) { JobNode *jobNode = HASHMAP_ENTRY(node, JobNode, hashNode); int code = 0; - for (size_t i = 0; i < strlen(jobNode->name); i++) { + size_t nameLen = strlen(jobNode->name); + for (size_t i = 0; i < nameLen; i++) { code += jobNode->name[i] - 'A'; } return code; @@ -605,7 +606,8 @@ static int JobNodeGetKeyHasCode(const void *key) { int code = 0; const char *buff = (char *)key; - for (size_t i = 0; i < strlen(buff); i++) { + size_t buffLen = strlen(buff); + for (size_t i = 0; i < buffLen; i++) { code += buff[i] - 'A'; } return code; diff --git a/services/param/watcher/agent/watcher_manager_kits.cpp b/services/param/watcher/agent/watcher_manager_kits.cpp index 216d5a28e..2e28b1d84 100755 --- a/services/param/watcher/agent/watcher_manager_kits.cpp +++ b/services/param/watcher/agent/watcher_manager_kits.cpp @@ -135,9 +135,9 @@ int32_t WatcherManagerKits::AddWatcher(const std::string &keyPrefix, ParameterCh watcher = new ParamWatcher(keyPrefix, callback, context); WATCHER_CHECK(watcher != nullptr, return -1, "Failed to create watcher for %s", keyPrefix.c_str()); auto watcherManager = GetService(); - WATCHER_CHECK(watcherManager != nullptr, return -1, "Failed to get watcher manager"); + WATCHER_CHECK(watcherManager != nullptr, delete watcher; return -1, "Failed to get watcher manager"); uint32_t watcherId = watcherManager->AddWatcher(keyPrefix, watcher); - WATCHER_CHECK(watcherId != 0, return -1, "Failed to add watcher for %s", keyPrefix.c_str()); + WATCHER_CHECK(watcherId != 0, delete watcher; return -1, "Failed to add watcher for %s", keyPrefix.c_str()); watcher->SetWatcherId(watcherId); SetParamWatcher(keyPrefix, watcher); return watcher->GetWatcherId(); diff --git a/services/utils/init_utils.c b/services/utils/init_utils.c index 10fd7513e..2b88d3bec 100755 --- a/services/utils/init_utils.c +++ b/services/utils/init_utils.c @@ -58,7 +58,8 @@ uid_t DecodeUid(const char *name) { INIT_CHECK_RETURN_VALUE(name != NULL, -1); int digitFlag = 1; - for (unsigned int i = 0; i < strlen(name); ++i) { + size_t nameLen = strlen(name); + for (unsigned int i = 0; i < nameLen; ++i) { if (isalpha(name[i])) { digitFlag = 0; break; diff --git a/ueventd/ueventd_read_cfg.c b/ueventd/ueventd_read_cfg.c index 7cbdcb3c0..04d90caf7 100755 --- a/ueventd/ueventd_read_cfg.c +++ b/ueventd/ueventd_read_cfg.c @@ -216,9 +216,6 @@ int ParseUeventConfig(char *buffer) static void DoUeventConfigParse(char *buffer, size_t length) { - if (length < 0) { - return; - } char **items = NULL; int count = -1; const int maxItemCount = DEFAULTITEMCOUNT; From fa76b58de487437219add5570bbc69e252c55f86 Mon Sep 17 00:00:00 2001 From: zgit2021 Date: Thu, 24 Mar 2022 10:21:59 +0000 Subject: [PATCH 21/29] =?UTF-8?q?fix=20dsoftbus=E2=80=98s=20permission=20t?= =?UTF-8?q?oo=20large=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgit2021 --- services/etc/group | 1 + services/etc/passwd | 1 + 2 files changed, 2 insertions(+) diff --git a/services/etc/group b/services/etc/group index b0826820b..83f275f94 100755 --- a/services/etc/group +++ b/services/etc/group @@ -16,6 +16,7 @@ keystore:x:1017: usb:x:1018: drm:x:1019: media_rw:x:1023: +dsoftbus:x:1024: nfc:x:1027: sdcard_r:x:1028: package_info:x:1032: diff --git a/services/etc/passwd b/services/etc/passwd index 96417d966..a3ee88780 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -17,6 +17,7 @@ keystore:x:1017:1017:::/bin/false usb:x:1018:1018:::/bin/false drm:x:1019:1019:::/bin/false media_rw:x:1023:1023:::/bin/false +dsoftbus:x:1024:1024:::/bin/false nfc:x:1027:1027:::/bin/false sdcard_r:x:1028:1028:::/bin/false package_info:x:1032:1032:::/bin/false From 82c331113ba043b10c78abaf64132fa06077ab7e Mon Sep 17 00:00:00 2001 From: zhanghaibo Date: Fri, 25 Mar 2022 11:25:06 +0800 Subject: [PATCH 22/29] add /system/usr to sandbox Signed-off-by: zhanghaibo Change-Id: Ibc21cc0ee7de6b341096fc7141fcc80d5fd211e8 --- interfaces/innerkits/sandbox/system-sandbox.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interfaces/innerkits/sandbox/system-sandbox.json b/interfaces/innerkits/sandbox/system-sandbox.json index 0af56aa20..ac5ab6c35 100644 --- a/interfaces/innerkits/sandbox/system-sandbox.json +++ b/interfaces/innerkits/sandbox/system-sandbox.json @@ -24,6 +24,10 @@ "src-path" : "/system/fonts", "sandbox-path" : "/system/fonts", "sandbox-flags" : [ "bind", "rec", "private" ] + }, { + "src-path" : "/system/usr", + "sandbox-path" : "/system/usr", + "sandbox-flags" : [ "bind", "rec", "private" ] }, { "src-path" : "/vendor", "sandbox-path" : "/vendor", From a043e15361aabd9173e2c7fb61bdd7eccb04f7ee Mon Sep 17 00:00:00 2001 From: SUE Date: Fri, 25 Mar 2022 08:54:39 +0000 Subject: [PATCH 23/29] Signed-off-by:hellohyh001 --- services/etc/group | 1 + services/etc/passwd | 1 + 2 files changed, 2 insertions(+) diff --git a/services/etc/group b/services/etc/group index 83f275f94..3b194a64e 100755 --- a/services/etc/group +++ b/services/etc/group @@ -59,5 +59,6 @@ a2dp_host:x:3043: hdf_devmgr:x:3044: connected_tag_host:x:3045: dms:x:5522: +sensor:x:6688: misc:x:9998: app:x:10000: diff --git a/services/etc/passwd b/services/etc/passwd index a3ee88780..1fde572c9 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -60,5 +60,6 @@ a2dp_host:x:3043:3043:::/bin/false hdf_devmgr:x:3044:3044:::/bin/false connected_tag_host:x:3045:3045:::/bin/false dms:x:5522:5522:::/bin/false +sensor:x:6688:6688:::/bin/false misc:x:9998:9998:::/bin/false app:x:10000:10000:::/bin/false From 77844fba309e7e302ed4e0c3bd77e82a0ce61599 Mon Sep 17 00:00:00 2001 From: xia-haoran1 Date: Mon, 28 Mar 2022 10:31:09 +0800 Subject: [PATCH 24/29] modify sensors process access Signed-off-by:xia-haoran1 Signed-off-by: xia-haoran1 --- services/etc/group | 1 + services/etc/passwd | 1 + 2 files changed, 2 insertions(+) diff --git a/services/etc/group b/services/etc/group index 3b194a64e..7b1b2fa0c 100755 --- a/services/etc/group +++ b/services/etc/group @@ -60,5 +60,6 @@ hdf_devmgr:x:3044: connected_tag_host:x:3045: dms:x:5522: sensor:x:6688: +msdp:x:6699: misc:x:9998: app:x:10000: diff --git a/services/etc/passwd b/services/etc/passwd index 1fde572c9..785efc7a2 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -61,5 +61,6 @@ hdf_devmgr:x:3044:3044:::/bin/false connected_tag_host:x:3045:3045:::/bin/false dms:x:5522:5522:::/bin/false sensor:x:6688:6688:::/bin/false +msdp:x:6699:6699:::/bin/false misc:x:9998:9998:::/bin/false app:x:10000:10000:::/bin/false From bd3575c489ae8c88091a4ed9a0ddf8664fd3b928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zen=E7=9F=A5=E4=BB=81?= Date: Mon, 28 Mar 2022 12:27:35 +0800 Subject: [PATCH 25/29] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E7=AD=89=E7=BA=A7=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=E7=9A=84gid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Zen知仁 --- services/etc/group | 1 + services/etc/passwd | 1 + 2 files changed, 2 insertions(+) diff --git a/services/etc/group b/services/etc/group index 3b194a64e..ef60c4b34 100755 --- a/services/etc/group +++ b/services/etc/group @@ -58,6 +58,7 @@ nfc_host:x:3042: a2dp_host:x:3043: hdf_devmgr:x:3044: connected_tag_host:x:3045: +dslm:x:3046: dms:x:5522: sensor:x:6688: misc:x:9998: diff --git a/services/etc/passwd b/services/etc/passwd index 1fde572c9..544543b74 100755 --- a/services/etc/passwd +++ b/services/etc/passwd @@ -59,6 +59,7 @@ nfc_host:x:3042:3042:::/bin/false a2dp_host:x:3043:3043:::/bin/false hdf_devmgr:x:3044:3044:::/bin/false connected_tag_host:x:3045:3045:::/bin/false +dslm:x:3046:3046:::/bin/false dms:x:5522:5522:::/bin/false sensor:x:6688:6688:::/bin/false misc:x:9998:9998:::/bin/false From aa7fdb166d911bb546270aa94ab8140047095433 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 28 Mar 2022 14:46:27 +0800 Subject: [PATCH 26/29] add samgr gid Signed-off-by: chen Change-Id: I636b0b460a2f6856314ad6a66f01c4d64d403a42 --- services/etc/group | 1 + 1 file changed, 1 insertion(+) diff --git a/services/etc/group b/services/etc/group index 3b194a64e..0813af9ec 100755 --- a/services/etc/group +++ b/services/etc/group @@ -4,6 +4,7 @@ system:x:1000: radio:x:1001: bluetooth:x:1002: graphics:x:1003: +samgr:x:1005: file_manager:x:1006: log:x:1007: user_data_rw:x:1008: From be9d18660e34add416fff492ee7fcbeb2518082c Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Mon, 28 Mar 2022 20:04:02 +0800 Subject: [PATCH 27/29] fix: commitid Signed-off-by: xionglei6 --- services/include/param/sys_param.h | 1 + services/param/include/param_trie.h | 1 + services/param/service/param_service.c | 4 ++++ test/plugintest/plugin_param_cmd.c | 3 ++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/services/include/param/sys_param.h b/services/include/param/sys_param.h index 270933a5b..44e15d405 100755 --- a/services/include/param/sys_param.h +++ b/services/include/param/sys_param.h @@ -97,6 +97,7 @@ int SystemWatchParameter(const char *keyprefix, ParameterChangePtr change, void void SystemDumpParameters(int verbose); int SysCheckParamExist(const char *name); +long long GetSystemCommitId(); #ifdef __cplusplus #if __cplusplus } diff --git a/services/param/include/param_trie.h b/services/param/include/param_trie.h index d5ef29afc..3e158cf7a 100755 --- a/services/param/include/param_trie.h +++ b/services/param/include/param_trie.h @@ -85,6 +85,7 @@ typedef struct { } ParamSecruityNode; typedef struct { + atomic_llong commitId; uint32_t trieNodeCount; uint32_t paramNodeCount; uint32_t securityNodeCount; diff --git a/services/param/service/param_service.c b/services/param/service/param_service.c index f5a520fdc..6650e751a 100755 --- a/services/param/service/param_service.c +++ b/services/param/service/param_service.c @@ -70,6 +70,8 @@ static int AddParam(WorkSpace *workSpace, const char *name, const char *value, u uint32_t offset = AddParamNode(workSpace, name, strlen(name), value, strlen(value)); PARAM_CHECK(offset > 0, return PARAM_CODE_REACHED_MAX, "Failed to allocate name %s", name); SaveIndex(&node->dataIndex, offset); + long long globalCommitId = atomic_load_explicit(&workSpace->area->commitId, memory_order_relaxed); + atomic_store_explicit(&workSpace->area->commitId, ++globalCommitId, memory_order_release); } if (dataIndex != NULL) { *dataIndex = node->dataIndex; @@ -86,6 +88,7 @@ static int UpdateParam(const WorkSpace *workSpace, uint32_t *dataIndex, const ch uint32_t valueLen = strlen(value); uint32_t commitId = atomic_load_explicit(&entry->commitId, memory_order_relaxed); atomic_store_explicit(&entry->commitId, commitId | PARAM_FLAGS_MODIFY, memory_order_relaxed); + long long globalCommitId = atomic_load_explicit(&workSpace->area->commitId, memory_order_relaxed); if (entry->valueLength < PARAM_VALUE_LEN_MAX && valueLen < PARAM_VALUE_LEN_MAX) { int ret = memcpy_s(entry->data + entry->keyLength + 1, PARAM_VALUE_LEN_MAX, value, valueLen + 1); @@ -94,6 +97,7 @@ static int UpdateParam(const WorkSpace *workSpace, uint32_t *dataIndex, const ch } uint32_t flags = commitId & ~PARAM_FLAGS_COMMITID; atomic_store_explicit(&entry->commitId, (++commitId) | flags, memory_order_release); + atomic_store_explicit(&workSpace->area->commitId, ++globalCommitId, memory_order_release); futex_wake(&entry->commitId, INT_MAX); return 0; } diff --git a/test/plugintest/plugin_param_cmd.c b/test/plugintest/plugin_param_cmd.c index 00ac6e073..346154efe 100755 --- a/test/plugintest/plugin_param_cmd.c +++ b/test/plugintest/plugin_param_cmd.c @@ -83,7 +83,8 @@ static int32_t BShellParamCmdRead(BShellHandle shell, int32_t argc, char *argv[] static void HandleParamChange(const char *key, const char *value, void *context) { PLUGIN_CHECK(key != NULL && value != NULL, return, "Invalid parameter"); - printf("Receive parameter change %s %s \n", key, value); + long long commit = GetSystemCommitId(); + printf("Receive parameter commit %lld change %s %s \n", commit, key, value); } static void *CmdWatcher(void *args) From 72e123d1291a094c1f8e2511438f0c9fc580f697 Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Mon, 28 Mar 2022 20:35:38 +0800 Subject: [PATCH 28/29] fix: commitid Signed-off-by: xionglei6 --- services/param/client/param_request.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/param/client/param_request.c b/services/param/client/param_request.c index 6a1627ec4..a46b5de4a 100755 --- a/services/param/client/param_request.c +++ b/services/param/client/param_request.c @@ -307,6 +307,12 @@ int SystemGetParameterCommitId(ParamHandle handle, uint32_t *commitId) return ReadParamCommitId(&g_clientSpace.paramSpace, handle, commitId); } +long long GetSystemCommitId() +{ + PARAM_CHECK(g_clientSpace.paramSpace.paramSpace.area != NULL, return 0, "The handle is null"); + return g_clientSpace.paramSpace.paramSpace.area->commitId; +} + int SystemGetParameterName(ParamHandle handle, char *name, unsigned int len) { PARAM_CHECK(name != NULL && handle != 0, return -1, "The name is null"); From 3c5ab30b697e2b9f5558bfd020f424e8544f058b Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Tue, 29 Mar 2022 08:26:19 +0800 Subject: [PATCH 29/29] fix: codestyle Signed-off-by: xionglei6 --- services/include/param/sys_param.h | 2 +- services/param/client/param_request.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/include/param/sys_param.h b/services/include/param/sys_param.h index 44e15d405..b7ce94f2a 100755 --- a/services/include/param/sys_param.h +++ b/services/include/param/sys_param.h @@ -97,7 +97,7 @@ int SystemWatchParameter(const char *keyprefix, ParameterChangePtr change, void void SystemDumpParameters(int verbose); int SysCheckParamExist(const char *name); -long long GetSystemCommitId(); +long long GetSystemCommitId(void); #ifdef __cplusplus #if __cplusplus } diff --git a/services/param/client/param_request.c b/services/param/client/param_request.c index a46b5de4a..b44e8ec92 100755 --- a/services/param/client/param_request.c +++ b/services/param/client/param_request.c @@ -307,7 +307,7 @@ int SystemGetParameterCommitId(ParamHandle handle, uint32_t *commitId) return ReadParamCommitId(&g_clientSpace.paramSpace, handle, commitId); } -long long GetSystemCommitId() +long long GetSystemCommitId(void) { PARAM_CHECK(g_clientSpace.paramSpace.paramSpace.area != NULL, return 0, "The handle is null"); return g_clientSpace.paramSpace.paramSpace.area->commitId;