Fix: l1_linux watchdog_service和ueventd降权

Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
This commit is contained in:
cheng_jinsong 2022-09-27 12:22:34 +08:00 committed by chengjinsong2
parent 43c3f7ad0b
commit 2dba360e78
4 changed files with 13 additions and 8 deletions

View File

@ -3,3 +3,5 @@ bin:x:2:
system:x:1000:
servicectrl:x:1050:root,shell,system,samgr,hdf_devmgr
shell:x:2000:
watchdog:x:2001:root
ueventd:x:2002:root

View File

@ -2,3 +2,5 @@ root:x:0:0:::/bin/false
bin:x:2:2:::/bin/false
system:x:1000:1000:::/bin/false
shell:x:2000:2000:::/bin/false
watchdog:x:2001:2001:::/bin/false
ueventd:x:2002:2002:::/bin/false

View File

@ -629,12 +629,12 @@ static void CheckService(const cJSON* curItem)
}
cJSON *filedJ = cJSON_GetObjectItem(curItem, "uid");
EXPECT_TRUE(cJSON_IsNumber(filedJ));
EXPECT_TRUE(cJSON_GetNumberValue(filedJ) >= 0.0);
EXPECT_TRUE(cJSON_IsNumber(filedJ) || cJSON_IsString(filedJ));
EXPECT_TRUE(cJSON_GetNumberValue(filedJ) >= 0.0 || cJSON_GetStringValue(filedJ));
filedJ = cJSON_GetObjectItem(curItem, "gid");
EXPECT_TRUE(cJSON_IsNumber(filedJ));
EXPECT_TRUE(cJSON_GetNumberValue(filedJ) >= 0.0);
EXPECT_TRUE(cJSON_IsNumber(filedJ) || cJSON_IsArray(filedJ));
EXPECT_TRUE(cJSON_GetNumberValue(filedJ) >= 0.0 || cJSON_GetArraySize(filedJ) >= 0);
filedJ = cJSON_GetObjectItem(curItem, "once");
EXPECT_TRUE(cJSON_IsNumber(filedJ));
@ -648,8 +648,8 @@ static void CheckService(const cJSON* curItem)
EXPECT_TRUE(capsCnt <= MAX_CAPS_CNT_FOR_ONE_SERVICE);
for (int i = 0; i < capsCnt; ++i) {
cJSON *capJ = cJSON_GetArrayItem(filedJ, i);
EXPECT_TRUE(cJSON_IsNumber(capJ));
EXPECT_TRUE(cJSON_GetNumberValue(capJ) >= 0.0);
EXPECT_TRUE(cJSON_IsNumber(capJ) || cJSON_GetStringValue(capJ));
EXPECT_TRUE(cJSON_GetNumberValue(capJ) >= 0.0 || cJSON_GetStringValue(capJ));
}
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@ -15,3 +15,4 @@
# <device name> <mode> <uid> <gid>
/dev/binder 0666 0 0
/dev/mmz_userdev 0666 0 0
/dev/watchdog 0660 watchdog watchdog