From: Michael Tokarev Date: Fri, 29 Nov 2024 06:34:42 +0000 (+0300) Subject: include for setgroups in a few places X-Git-Tag: tdb-1.4.13~237 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a560ba4896c34eca1b4c473bb140e24da650307;p=thirdparty%2Fsamba.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 Reviewed-by: Andreas Schneider Reviewed-by: Pavel Filipenský Autobuild-User(master): Pavel Filipensky Autobuild-Date(master): Thu Jan 2 17:58:50 UTC 2025 on atb-devel-224 --- diff --git a/lib/util/setid.c b/lib/util/setid.c index 6447909a5f3..a714e699f00 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 ba6f109dcb7..2dab2855858 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