mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-27 02:10:33 +00:00
OpenHarmony console降权(非root)修改passwd shadow文件适配
Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
This commit is contained in:
parent
a20a07af21
commit
0689dad6f2
2
OAT.xml
2
OAT.xml
@ -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"/-->
|
||||
|
@ -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"
|
||||
|
18
services/etc/console.user.cfg
Normal file
18
services/etc/console.user.cfg
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user