Support multiple users interacting with shm with starterd
The permission restrictions of signals make it hard to have AOS
applications started as arbitrary users communicate. Instead, make
starter run as the provided --user with the effective UID that it
started with. This makes shmem end up with all the right permissions so
everything can communicate.
Change-Id: I3c7fbfe8a73e7341ca32c010da1c38b5ba787523
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starterd_lib.h b/aos/starter/starterd_lib.h
index cd4b40a..2bbfa22 100644
--- a/aos/starter/starterd_lib.h
+++ b/aos/starter/starterd_lib.h
@@ -109,6 +109,7 @@
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> &v);
static std::optional<uid_t> FindUid(const char *name);
+ static std::optional<gid_t> FindPrimaryGidForUser(const char *name);
// Next unique id for all applications
static inline uint64_t next_id_ = 0;
@@ -117,6 +118,7 @@
std::string path_;
std::vector<char *> args_;
std::optional<uid_t> user_;
+ std::optional<gid_t> group_;
pid_t pid_ = -1;
ScopedPipe::ScopedReadPipe read_pipe_;