/base/security/selinux_adapter/framework/tools/param_check/ |
H A D | test.cpp | 43 std::string paraName; member 74 std::cout << "param: " << buff->info.paraName << ", contexts: " << buff->info.paraContext in TestLoadList() 90 static void TestGetContext(std::string ¶Name) in TestGetContext() argument 96 const char *context = GetParamLabel(paraName.c_str()); in TestGetContext() 97 int index = GetParamLabelIndex(paraName.c_str()); in TestGetContext() 98 std::cout << "paraName: " << paraName << "context: " << context << " index: " << index << std::endl; in TestGetContext() 105 std::cout << "para " << paraName.c_str() << "'s context is " << context << std::endl; in TestGetContext() 108 static void TestReadPara(std::string ¶Name) in TestReadPara() argument 114 const char *contexts = GetParamLabel(paraName in TestReadPara() 129 TestSetPara(std::string ¶Name, SrcInfo *info) TestSetPara() argument 224 std::string paraName; TestWriteParameters() local 235 std::string paraName; Test() local [all...] |
/base/security/selinux_adapter/framework/policycoreutils/src/ |
H A D | sehap_contexts_trie.cpp | 22 std::vector<std::string> SehapContextsTrie::SplitString(const std::string& paraName) in SplitString() argument 26 size_t len = paraName.length(); in SplitString() 30 if ((pos = paraName.substr(index).find(delimiter)) == std::string::npos) { in SplitString() 33 std::string element = paraName.substr(index, pos); in SplitString() 39 if (!paraName.substr(index).empty()) { in SplitString() 40 words.emplace_back(paraName.substr(index)); in SplitString() 55 bool SehapContextsTrie::Insert(const std::string& paraName, const std::string& domain, const std::string& type) in Insert() argument 58 std::vector<std::string> words = SplitString(paraName); in Insert() 72 if ((paraName.back() == '.') || (paraName in Insert() 84 Search(const std::string& paraName, bool isDomain) Search() argument [all...] |
H A D | selinux_parameter.c | 82 const char *GetParamLabel(const char *paraName) in GetParamLabel() argument 84 if (paraName == NULL || g_contextsTrie == NULL) { in GetParamLabel() 87 return SearchFromParamTrie(g_contextsTrie, paraName); in GetParamLabel() 90 int GetParamLabelIndex(const char *paraName) in GetParamLabelIndex() argument 92 if ((paraName == NULL) || (g_contextsTrie == NULL)) { in GetParamLabelIndex() 95 return GetLabelIndex(g_contextsTrie, paraName); in GetParamLabelIndex()
|
H A D | param_checker.c | 60 static int CheckPerm(const char *paraName, const char *srcContext, const char *destContext, const struct ucred *uc) in CheckPerm() argument 66 selinux_log(SELINUX_INFO, "srcContext[%s] is setting param[%s] destContext[%s]\n", srcContext, paraName, in CheckPerm() 69 msg.name = paraName; in CheckPerm() 82 int SetParamCheck(const char *paraName, const char *destContext, const SrcInfo *info) in SetParamCheck() argument 84 if (paraName == NULL || destContext == NULL || info == NULL) { in SetParamCheck() 96 int res = CheckPerm(paraName, srcContext, destContext, &(info->uc)); in SetParamCheck()
|
H A D | contexts_trie.c | 139 const char *SearchFromParamTrie(ParamContextsTrie *root, const char *paraName) in SearchFromParamTrie() argument 142 const char *tmpName = paraName; in SearchFromParamTrie() 175 int GetLabelIndex(ParamContextsTrie *root, const char *paraName) in GetLabelIndex() argument 178 const char *tmpName = paraName; in GetLabelIndex() 237 node->info.paraName = param; in InsertContextsList()
|
/base/security/selinux_adapter/interfaces/policycoreutils/include/ |
H A D | selinux_parameter.h | 30 const char *paraName; member 68 * @brief for a particular paraName, get its context 70 * @param paraName the name of param 72 * @return context for given paraName 74 const char *GetParamLabel(const char *paraName); 76 * @brief for a particular paraName, get its context index 78 * @param paraName the name of param 80 * @return context index for given paraName 82 int GetParamLabelIndex(const char *paraName);
|
H A D | sehap_contexts_trie.h | 33 bool Insert(const std::string ¶Name, const std::string &domain, const std::string &type); 34 std::string Search(const std::string ¶Name, bool isDomain); 41 std::vector<std::string> SplitString(const std::string ¶Name);
|
H A D | contexts_trie.h | 33 const char* SearchFromParamTrie(ParamContextsTrie *root, const char *paraName); 34 int GetLabelIndex(ParamContextsTrie *root, const char *paraName);
|
H A D | param_checker.h | 36 * @brief for write particular paraName, check permission 38 * @param paraName the name of param 39 * @param destContext the context of paraName 43 int SetParamCheck(const char *paraName, const char *destContext, const SrcInfo *info);
|
/base/startup/init/services/param/adapter/ |
H A D | param_selinux.c | 35 typedef int (*SelinuxSetParamCheck)(const char *paraName, const char *destContext, const SrcInfo *info);
138 PARAM_LOGE("Forbid to add selinux workspace %s %s", paramNode->paraName, paramNode->paraContext);
in HandleSelinuxLabelForOpen() 143 SetSelinuxFileCon(paramNode->paraName, paramNode->paraContext);
in HandleSelinuxLabelForOpen() 169 node->info.index, node->info.paraName, node->info.paraContext);
in SelinuxGetAllLabel() 170 if (node->info.paraContext == NULL || node->info.paraName == NULL) {
in SelinuxGetAllLabel() 190 if (*(paramNode->paraName + strlen(paramNode->paraName) - 1) != '.') {
in HandleSelinuxLabelForPermission() 197 PARAM_CHECK(space != NULL && space->area != NULL, return, "Failed to get dac space %s", paramNode->paraName);
in HandleSelinuxLabelForPermission() 199 (void)FindTrieNode(space, paramNode->paraName, strlen(paramNode->paraName), in HandleSelinuxLabelForPermission() [all...] |
/base/startup/init/test/unittest/param/ |
H A D | param_stub.cpp | 74 static int TestSetParamCheck(const char *paraName, const char *context, const SrcInfo *info) in TestSetParamCheck() argument 76 BEGET_LOGI("TestSetParamCheck %s result %d", paraName, g_testPermissionResult); in TestSetParamCheck() 80 static const char *TestGetParamLabel(const char *paraName) in TestGetParamLabel() argument 82 BEGET_LOGI("TestGetParamLabel %s", paraName); in TestGetParamLabel() 83 if (paraName == nullptr) { in TestGetParamLabel() 87 if (strncmp(selinuxLabels[i][0], paraName, strlen(selinuxLabels[i][0])) == 0) { in TestGetParamLabel() 91 int code = TestGenHashCode(paraName); in TestGetParamLabel() 96 static int32_t TestGetSelinuxLabelIndex(const char *paraName) in TestGetSelinuxLabelIndex() argument 99 if (strncmp(selinuxLabels[i][0], paraName, strlen(selinuxLabels[i][0])) == 0) { in TestGetSelinuxLabelIndex() 103 int code = TestGenHashCode(paraName); in TestGetSelinuxLabelIndex() 112 TestReadParamCheck(const char *paraName) TestReadParamCheck() argument [all...] |
H A D | param_stub.h | 49 const char *paraName;
member
|
/base/startup/init/services/param/include/ |
H A D | param_security.h | 117 int (*setParamCheck)(const char *paraName, const char *destContext, const SrcInfo *info);
118 const char *(*getParamLabel)(const char *paraName);
120 int (*readParamCheck)(const char *paraName);
123 int (*getParamLabelIndex)(const char *paraName);
|