OpenHarmony console降权(非root)修改passwd shadow文件适配

Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
This commit is contained in:
cheng_jinsong 2023-05-15 10:16:57 +08:00
parent a20a07af21
commit 0689dad6f2
3 changed files with 29 additions and 1 deletions

View File

@ -38,11 +38,13 @@
<filteritem type="filename" name="*.cfg" desc="config file,can not add license head"/>
<filteritem type="filename" name="passwd" desc="config file,can not add license head"/>
<filteritem type="filename" name="group" desc="config file,can not add license head"/>
<filteritem type="filename" name="shadow" desc="config file,can not add license head"/>
</filefilter>
<filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies">
<filteritem type="filename" name="*.cfg" desc="config file,can not add license head"/>
<filteritem type="filename" name="passwd" desc="config file,can not add license head"/>
<filteritem type="filename" name="group" desc="config file,can not add license head"/>
<filteritem type="filename" name="shadow" desc="config file,can not add license head"/>
</filefilter>
<filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies">
<!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/-->

View File

@ -73,7 +73,15 @@ if (defined(ohos_lite)) {
}
ohos_prebuilt_etc("console.cfg") {
image_name = [ "system" ]
if (build_variant == "user") {
source = "//base/startup/init/services/etc/console.user.cfg"
image_name += [ "eng_system" ]
} else if (build_variant == "root") {
source = "//base/startup/init/services/etc/console.cfg"
}
install_images = image_name
output = "console.cfg"
relative_install_dir = "init"
part_name = "init"
subsystem_name = "startup"

View File

@ -0,0 +1,18 @@
{
"services" : [{
"name" : "console",
"path" : ["/system/bin/sh"],
"disabled" : 1,
"console" : 1,
"sandbox" : 0,
"uid" : "shell",
"gid" : ["shell", "log", "readproc"],
"ondemand" : true,
"jobs" : {
"on-start" : "services:console"
},
"caps" : ["SETGID", "SETUID"],
"secon" : "u:r:console:s0"
}
]
}