From 1c0f63b047517c123b2e9764e21631a4219cf70c Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Fri, 29 Nov 2024 09:34:42 +0300 Subject: [PATCH] include for setgroups in a few places setgroups(), unlike getgroups(), is not in but in . Recent compilers require function declaration before using a function (or more and more distributions treat lack of declaration as error), so all configure-time tests fails with source3/lib/util_sec.c: source3/../lib/util/setid.c: In function 'samba_setgroups': source3/../lib/util/setid.c:244:16: error: implicit declaration of function \ 'setgroups'; did you mean 'getgroups'? [-Wimplicit-function-declaration] 244 | return setgroups(setlen, gidset); Add the missing include so configuration finds the existing system functions instead of failing. Signed-off-by: Michael Tokarev Gbp-Pq: Name include-grp.h-for-setgroups-in-a-few-places.patch --- lib/util/setid.c | 3 +++ source3/lib/util_sec.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/util/setid.c b/lib/util/setid.c index 10014618..f6c881ef 100644 --- a/lib/util/setid.c +++ b/lib/util/setid.c @@ -29,6 +29,9 @@ #if defined(HAVE_UNISTD_H) #include #endif +#if defined(HAVE_GRP_H) +#include /* setgroups() */ +#endif #include #include #include diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index 5569df4e..91b728b6 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -28,6 +28,9 @@ #if defined(HAVE_UNISTD_H) #include #endif +#if defined(HAVE_GRP_H) +#include /* setgroups() */ +#endif #include #include #include -- 2.30.2