#include <sys/smack.h>
#include <unistd.h>
#include <stdexcept>
+#include <string_view>
+#include <unordered_set>
#include <dpl/log/log.h>
#include <dpl/errno_string.h>
return SECURITY_MANAGER_ERROR_AUTHENTICATION_FAILED;
}
+ // Check that all apps have unique names
+ {
+ std::unordered_set<std::string_view> appNames;
+ for (const auto& app : req.apps) {
+ if (!appNames.emplace(app.appName).second) {
+ LogError("Found two applications with name: " << app.appName
+ << ". Returning error.");
+ return SECURITY_MANAGER_ERROR_INPUT_PARAM;
+ }
+ }
+ }
+
return SECURITY_MANAGER_SUCCESS;
}