修改bug

Signed-off-by: xionglei6 <xionglei6@huawei.com>
This commit is contained in:
xionglei6 2022-01-26 18:20:19 +08:00
parent 93dde26215
commit 2ba256b777
3 changed files with 9 additions and 8 deletions

View File

@ -37,7 +37,7 @@ config("appspawn_config") {
]
if (build_selinux) {
cflags += [ "-DWITH_SELINUX" ]
cflags = [ "-DWITH_SELINUX" ]
}
}
@ -48,9 +48,7 @@ ohos_executable("appspawn") {
"${appspawn_path}:appspawn_server",
"//base/security/access_token/interfaces/innerkits/token_setproc:libtoken_setproc",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
install_enable = true
subsystem_name = "${subsystem_name}"

View File

@ -87,7 +87,9 @@ public:
static constexpr int LEN_PROC_NAME = 256; // process name length
static constexpr int LEN_SO_PATH = 256; // load so lib
static constexpr int MAX_GIDS = 64;
#ifdef WITH_SELINUX
static constexpr int APL_MAX_LEN = 32;
#endif
struct AppProperty {
uint32_t uid; // the UNIX uid that the child process setuid() to after fork()
@ -97,7 +99,9 @@ public:
char processName[LEN_PROC_NAME]; // process name
char soPath[LEN_SO_PATH]; // so lib path
uint32_t accessTokenId;
char apl[APL_MAX_LEN];
#ifdef WITH_SELINUX
char apl[APL_MAX_LEN];
#endif
};
private:

View File

@ -52,7 +52,7 @@ ohos_unittest("AppSpawnServerOverrideTest") {
if (build_selinux) {
external_deps += [ "selinux:libhap_restorecon" ]
cflags += [ "-DWITH_SELINUX" ]
cflags = [ "-DWITH_SELINUX" ]
}
}
@ -94,9 +94,8 @@ ohos_unittest("AppSpawnServerMockTest") {
if (build_selinux) {
external_deps += [ "selinux:libhap_restorecon" ]
cflags += [ "-DWITH_SELINUX" ]
cflags = [ "-DWITH_SELINUX" ]
}
}
group("unittest") {