#1091850 djbdns: FTBFS: Oops. Your getgroups() returned 0, and setgroups() failed

Package:
src:djbdns
Source:
src:djbdns
Submitter:
Sebastian Ramacher
Date:
2025-01-01 15:06:04 UTC
Severity:
normal
Tags:
#1091850#5
Date:
2025-01-01 13:32:17 UTC
From:
To:
Source: djbdns
Version: 1:1.05-17
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
X-Debbugs-Cc: sramacher@debian.org

https://buildd.debian.org/status/fetch.php?pkg=djbdns&arch=amd64&ver=1%3A1.05-17&stamp=1735573976&raw=0

./makelib unix.a buffer_read.o buffer_write.o error.o \
error_str.o ndelay_off.o ndelay_on.o open_read.o \
open_trunc.o openreadclose.o readclose.o seek_set.o \
socket_accept.o socket_bind.o socket_conn.o socket_listen.o \
socket_recv.o socket_send.o socket_tcp.o socket_udp.o
./makelib byte.a byte_chr.o byte_copy.o byte_cr.o \
byte_diff.o byte_zero.o case_diffb.o case_diffs.o \
case_lowerb.o fmt_ulong.o ip4_fmt.o ip4_scan.o scan_ulong.o \
str_chr.o str_diff.o str_len.o str_rchr.o str_start.o \
uint16_pack.o uint16_unpack.o uint32_pack.o uint32_unpack.o
./makelib libtai.a tai_add.o tai_now.o tai_pack.o \
tai_sub.o tai_uint.o tai_unpack.o taia_add.o taia_approx.o \
taia_frac.o taia_less.o taia_now.o taia_pack.o taia_sub.o \
taia_tai.o taia_uint.o
./chkshsgr || ( cat warn-shsgr; exit 1 )
Oops. Your getgroups() returned 0, and setgroups() failed; this means
that I can't reliably do my shsgr test. Please either ``make'' as root
or ``make'' while you're in one or more supplementary groups.
make[1]: *** [Makefile:514: hasshsgr.h] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
dh_auto_build: error: make -j6 "INSTALL=install --strip-program=true" returned exit code 2

Cheers

#1091850#10
Date:
2025-01-01 14:00:19 UTC
From:
To:
Hi,

I saw this error with ipsvd as well.

The solution is to run that particular part under `fakeroot` (remember
explicit Builds-Depends on `fakeroot`).

I am not sure why it happens now. In ipsvd it was incorrectly attributed
to a `Rules-Requires-Root: no` change, but reverting it did not fix the
problem. I suspect something has changed on the buildd side recently.

Best regards,
Niels

#1091850#15
Date:
2025-01-01 14:18:10 UTC
From:
To:
Thanks for looking into this. I believe that what recently changed was that
the buildds started using user namespaces instead of schroot environments.
Thus, there are some issues around setgroups(2) as documented in
user_namespaces(7); I will look into this more.

The truth is, I noticed the messages about the buildds switching to user
namespaces, and the warning in the schroot package's changelog, and
I thought "yeah, I will switch away from directory schroots to something
else, but not today, I don't want to switch back to tarballs right now,
and I have some personal tooling around schroot, so let's do that later" :)
So I guess only catching this on the buildds is mostly on me - I knowingly
did not run my test builds in the same environment, since I kind of thought
there was no way anything that matters would be different :)

Well, apparently there is something different... Thanks for the fakeroot
suggestion, I was wondering whether to slap the full Rules-Requires-Root: yes
bandaid temporarily, but I know that is the nuclear option. The fakeroot
change might work until I look a bit deeper into this, set up a "real"
build environment locally, and try to figure out whether there is any
chance to help by writing to /proc/self/setgroups or something...

G'luck,
Peter

PS. BTW I haven't mentioned that, but, Niels, thanks for your continued
work on debhelper and for your push for Rules-Requires-Root: no.
For the packages I maintain, this is mostly already handled by
declaring dpkg-build-api v1, but still it is a good idea to apply it by
default across the board.

#1091850#20
Date:
2025-01-01 14:26:39 UTC
From:
To:
Peter Pentchev:

For ipsvd, that "nuclear option" did not even work. The affected code
was run in the `build` target and `fakeroot` from `Rules-Requires-Root`
does not apply to that target. If djbdns is the same here, then changing
`Rules-Requires-Root` will do nothing.

If you figure out a better solution than `fakeroot`, then we can
probably use it for ipsvd.

You are very welcome. :)

Best regards,
Niels

#1091850#23
Date:
2025-01-01 14:36:58 UTC
From:
To:
Hello,

Bug #1091850 in djbdns reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/debian/djbdns/-/commit/36775d62448916d25386e3d3e4095ba9658399c8
------------------------------------------------------------------------
Temporarily use fakeroot for setgroups(2)

Closes: #1091850
Suggested by: Niels Thykier <niels@thykier.net>
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1091850

#1091850#30
Date:
2025-01-01 15:04:37 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
djbdns, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1091850@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Peter Pentchev <roam@debian.org> (supplier of updated djbdns package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 01 Jan 2025 16:37:08 +0200
Source: djbdns
Architecture: source
Version: 1:1.05-18
Distribution: unstable
Urgency: medium
Maintainer: Peter Pentchev <roam@debian.org>
Changed-By: Peter Pentchev <roam@debian.org>
Closes: 1091850
Changes:
 djbdns (1:1.05-18) unstable; urgency=medium
 .
   * As a maybe temporary workaround suggested by Niels Thykier, use
     fakeroot during the build only for the build tools that try to
     use setgroups(2). Closes: #1091850
Checksums-Sha1:
 ffddf61e95db300791800d33b5aea14e223fde0b 2443 djbdns_1.05-18.dsc
 b397bfc958d99a9987bcaf021f278e9e1238e661 64428 djbdns_1.05-18.debian.tar.xz
Checksums-Sha256:
 89ed5618e2e60182d4bb05c75f4d3dc1236967658b7fa959d084a61b0e465932 2443 djbdns_1.05-18.dsc
 273c71169b0d4c45072648080a7fe57afa69ab41921ad413a4d4b353e2ee0933 64428 djbdns_1.05-18.debian.tar.xz
Files:
 bfcab85741720722cc69e934b0f7ffe2 2443 net optional djbdns_1.05-18.dsc
 ebc760a5626363c4c8bbdb58b83efc9b 64428 net optional djbdns_1.05-18.debian.tar.xz
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAmd1U8IQHHJvYW1AZGVi
aWFuLm9yZwAKCRBlHu+wJSffE0fiD/4sWOD8rZiWMlzo6LDrxpqnWnnRmyWSS0C0
mUexebzlZ7+UkNxJNs43L2DqmXpxxmiVvlbzMIkkkYSFslbZvMi5drwMZoi5vv2O
NAhHKaUWIMk7M2IrD6B6TMxpOeGFQESCJkmKaD6Pi2vR6DJnY481QetVgkgVcTfW
2YNLzooVuGQN+JrDe0HkH/BAhZLR2BMdTxi9OXNCMRynjwcRlatVCWdkomDs2Iih
afgewh/nlKTc4v6WbqxjmRDEWmYZECDyFxd1EmdBfGpo54BEtzKv4rpNmPgru28y
hQsvjv3wT4r4p8PB4npcb8RYJTtexdq3E2OwpRJph/bzjPAUkAz8DDwYYsyYr3Ki
3KttmSLjgEJK5QYZ+BxfeEKLqEvEroXzF/lA71EGCjwSbJK/2PKdB+a/i5bnTANo
BjiOcEL/EB1RwW/eTLi0YmVqc22uXNIF+/OvA/LPf6HW7UPUJFEKeHWIvQi4sfQ/
NPzzWQJB4qkLhU4jWkUNkYrs8JKR5qXQOewLsRufDj3ILHiXGA2Gx15s5WMgPWOq
c4OQllRFDTPZDCLLSAsBZuyJYYPtJp9VZfyaH03ogvNhMh8pB8ttx7FsPe/eElWt
1yYpvMomvxM8/hccQ+UpMYxeDWVaubvXnbchVzoNatD4AOeQnC/VMooEcfS2uBem
fEvMq9NyPA==
=MRA+
-----END PGP SIGNATURE-----