提交 c8b290c0 编写于 作者: C cheng_jinsong

支持非selinux编译

Signed-off-by: Ncheng_jinsong <chengjinsong2@huawei.com>
上级 0e7ea05c
......@@ -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,12 +22,6 @@
#include <sys/types.h>
#ifdef PARAM_SUPPORT_SELINUX
#include "selinux_parameter.h"
#else
typedef struct ParamContextsList_ {
} ParamContextsList;
typedef struct SrcInfo {
} SrcInfo;
#endif
#include "beget_ext.h"
......@@ -100,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);
......@@ -110,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.
先完成此消息的编辑!
想要评论请 注册