From 86dba5441c686d037c493e5b498e27249aa6bd9d Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 12 Feb 2026 14:54:23 +0100 Subject: lib: Fix SSM PUP creation on OS X OS X doesn't support chmod on shm files after creation. Since we already set the mode at creation, that call was redundant. Fixed the getpeereid() function was not accessible because of the guards. Fixed some differences between macOS and Linux with gid_t vs int usage. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/utils.c') diff --git a/src/lib/utils.c b/src/lib/utils.c index cfddec62..dffd35f3 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -150,8 +150,13 @@ bool is_ouroboros_member_uid(uid_t uid) { struct group * grp; struct passwd * pw; +#ifdef __APPLE__ + unsigned int gid; + int * groups = NULL; +#else gid_t gid; gid_t * groups = NULL; +#endif int ngroups; int i; @@ -187,7 +192,11 @@ bool is_ouroboros_member_uid(uid_t uid) } for (i = 0; i < ngroups; i++) { +#ifdef __APPLE__ + if (groups[i] == (int) gid) { +#else if (groups[i] == gid) { +#endif free(groups); return true; } -- cgit v1.2.3