include <grp.h> for setgroups in a few places
authorMichael Tokarev <mjt@tls.msk.ru>
Fri, 29 Nov 2024 06:34:42 +0000 (09:34 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 6 Jan 2025 18:20:31 +0000 (21:20 +0300)
commit6e2e4760ba98fe46b85fd4b283743f8d7040f8b8
treee663ebf5d4a0a069addf978e188e49396a80666d
parent9758cbeffcfbfeda807f577c7a50d0795e4eb11c
include <grp.h> for setgroups in a few places

setgroups(), unlike getgroups(), is not in <unistd.h> but in <grp.h>.
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 <mjt@tls.msk.ru>
Gbp-Pq: Name include-grp.h-for-setgroups-in-a-few-places.patch
lib/util/setid.c
source3/lib/util_sec.c