未验证 提交 b906991c 编写于 作者: O openharmony_ci 提交者: Gitee

!1336 系统优化-优化非selinux时编译

Merge pull request !1336 from cheng_jinsong/closeselinux
......@@ -32,6 +32,7 @@
#define CHECKER_LIB_NAME "/system/lib/libparaperm_checker.z.so"
#define CHECKER_UPDATER_LIB_NAME "/lib/libparaperm_checker.z.so"
#endif
typedef int (*SelinuxSetParamCheck)(const char *paraName, const char *destContext, const SrcInfo *info);
static int InitSelinuxOpsForInit(SelinuxSpace *selinuxSpace)
{
......
......@@ -22,14 +22,6 @@
#include <sys/types.h>
#ifdef PARAM_SUPPORT_SELINUX
#include "selinux_parameter.h"
#else
typedef struct ParamContextsList_ {
char unused;
} ParamContextsList;
typedef struct SrcInfo {
char unused;
} SrcInfo;
#endif
#include "beget_ext.h"
......@@ -102,9 +94,9 @@ typedef struct {
} ParamSecurityOps;
typedef int (*RegisterSecurityOpsPtr)(ParamSecurityOps *ops, int isInit);
typedef int (*SelinuxSetParamCheck)(const char *paraName, const char *destContext, const SrcInfo *info);
typedef struct SelinuxSpace_ {
void *selinuxHandle;
#ifdef PARAM_SUPPORT_SELINUX
void (*setSelinuxLogCallback)(void);
int (*setParamCheck)(const char *paraName, const char *destContext, const SrcInfo *info);
const char *(*getParamLabel)(const char *paraName);
......@@ -112,6 +104,7 @@ typedef struct SelinuxSpace_ {
int (*readParamCheck)(const char *paraName);
ParamContextsList *(*getParamList)(void);
void (*destroyParamList)(ParamContextsList **list);
#endif
} SelinuxSpace;
#ifdef PARAM_SUPPORT_SELINUX
INIT_LOCAL_API int RegisterSecuritySelinuxOps(ParamSecurityOps *ops, int isInit);
......
......@@ -18,6 +18,8 @@
#include <cstdlib>
#include <cstring>
#include <gtest/gtest.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "param_manager.h"
#include "param_security.h"
......@@ -30,6 +32,23 @@ extern "C" {
#endif
#endif
#ifndef PARAM_SUPPORT_SELINUX
typedef struct ParameterNode {
const char *paraName;
const char *paraContext;
} ParameterNode;
typedef struct ParamContextsList {
struct ParameterNode info;
struct ParamContextsList *next;
} ParamContextsList;
typedef struct SrcInfo {
int sockFd;
struct ucred uc;
} SrcInfo;
#endif
void PrepareInitUnitTestEnv(void);
void TestSetSelinuxOps(void);
void SetTestPermissionResult(int result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册