From: Michael Tokarev Date: Fri, 29 Nov 2024 06:34:42 +0000 (+0300) Subject: include for setgroups in a few places X-Git-Tag: archive/raspbian/2%4.22.0+dfsg-1+rpi1^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1c0f63b047517c123b2e9764e21631a4219cf70c;p=samba.git 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 --- 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