#include <dirent.h>
#include <dlfcn.h>
#include <fcntl.h>
+#include <unistd.h>
#include <string>
#include <algorithm>
#include <klay/filesystem.h>
#include <klay/exception.h>
+#include <klay/auth/group.h>
#include <rmi/common.h>
std::mutex opGuard;
+gid_t getSystemShareGid()
+{
+ static runtime::Group systemShare("system_share");
+
+ return systemShare.getGid();
+}
+
// not thread-safe because of static member
class KeyStoragePlugin {
public:
size_t tokenSize(token.size());
file.create(S_IRUSR | S_IWUSR | S_IRGRP);
+ file.chown(getuid(), getSystemShareGid());
file.write(&tokenSize, sizeof(tokenSize));
file.write(token.data(), token.size());