From 03c1496e8e6fedbec2cd8daf1b04fb9676825540 Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Wed, 21 Jul 2021 22:19:46 +0800 Subject: [PATCH] sim: change ownership to user ID of the calling process for shm file Change-Id: Ia0b5721421c2eb7fb408d55a26f821d6e95202df Signed-off-by: Jiuzhu Dong --- arch/sim/src/sim/up_hostmemory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sim/src/sim/up_hostmemory.c b/arch/sim/src/sim/up_hostmemory.c index 0d8ddb18d9f..c338f9a5033 100644 --- a/arch/sim/src/sim/up_hostmemory.c +++ b/arch/sim/src/sim/up_hostmemory.c @@ -92,6 +92,8 @@ void *host_alloc_shmem(const char *name, size_t size, int master) return NULL; } + fchown(fd, getuid(), getgid()); + if (!master) { /* Avoid the second slave instance open successfully */