LogWarning("Unsupported rule <"
<< rule.subject << " " << rule.object << " " << rule.permissions
<< "> detected. Ignoring");
+ continue;
}
strReplace(rule.subject, SMACK_PROCESS_LABEL_TEMPLATE, appProcessLabel);
const std::map<TemplateManager::Type, std::string> TEMPLATE_PATH_MAP = {
{TemplateManager::Type::APP_RULES_TEMPLATE, "app-rules-template.smack"},
{TemplateManager::Type::PKG_RULES_TEMPLATE, "pkg-rules-template.smack"},
- {TemplateManager::Type::AUTHOR_RULES_TEMPLATE, "author-rules-template.smack"},
- {TemplateManager::Type::PRIV_DEFAULT_RULES_TEMPLATE, PRIV_TEMPLATE_DEFAULT_FILE}
+ {TemplateManager::Type::AUTHOR_RULES_TEMPLATE, "author-rules-template.smack"}
};
const std::string PRIV_TEMPLATE_DEFAULT = "default";
void TemplateManager::loadFiles()
{
std::string path = m_rootDir + "/" + PRIVILEGE_SMACK_LIST_FILE;
- auto raw = ConfigFile(path).read();
+ std::vector<std::vector<std::string>> raw;
+ try {
+ raw = ConfigFile(path).read();
+ } catch (const FS::Exception::FileError& e) {
+ LogWarning(e.GetMessage());
+ }
for(auto &privMapping : raw) {
if (privMapping.size() != 3) {
- std::string errorMsg = "Invalid mapping template: " + std::to_string(privMapping.size())
+ std::string warningMsg = "Invalid mapping template: " + std::to_string(privMapping.size())
+ " tokens in file " + path + ". Expected 3.";
- LogError(errorMsg);
- ThrowMsg(SmackException::FileError, errorMsg);
+ LogWarning(warningMsg);
+ continue;
}
auto &privName = privMapping[0];