Bug 15932 - build failure: missing header netgroup.h
Summary: build failure: missing header netgroup.h
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.21.7
Hardware: All NetBSD
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-08 14:27 UTC by Thomas Klausner
Modified: 2025-10-09 08:29 UTC (History)
1 user (show)

See Also:


Attachments
Patch fixing the build. (777 bytes, patch)
2025-10-08 14:27 UTC, Thomas Klausner
no flags Details
Updated patch (983 bytes, patch)
2025-10-09 08:29 UTC, Thomas Klausner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2025-10-08 14:27:14 UTC
Created attachment 18750 [details]
Patch fixing the build.

On NetBSD 11.99.3 with gcc 14.3.0, samba 4.21.7 (sorry for the old version, that's what in pkgsrc right now) doesn't build with:

../../lib/util/access.c: In function 'string_match':
../../lib/util/access.c:157:31: error: implicit declaration of function 'innetgr' [-Wimplicit-function-declaration]
  157 |                 netgroup_ok = innetgr(tok + 1, hostname, (char *) 0, mydomain);
      |                               ^~~~~~~


../../source3/auth/user_util.c: In function 'user_in_netgroup':
../../source3/auth/user_util.c:155:13: error: implicit declaration of function 'innetgr' [-Wimplicit-function-declaration]
  155 |         if (innetgr(ngname, NULL, user, nis_domain)) {
      |             ^~~~~~~



According to the NetBSD man page, this function is defined in netgroup.h, and adding the include to those two files fixes the build.
Comment 1 Douglas Bagnall 2025-10-08 20:53:15 UTC
Thanks.

We might want that to be wrapped in something like `#ifdef HAVE_NETGROUP_H`. Is that set in bin/default/include/config.h in your build directory?

If you read https://www.samba.org/samba/devel/copyright-policy.html (which boils down to sending an email) and create the patch in `git format-patch` style (or open a merge request per https://wiki.samba.org/index.php/Contribute#Submitting_Patches_via_GitLab), you get to have your name on it.
Comment 2 Thomas Klausner 2025-10-09 08:29:00 UTC
Created attachment 18751 [details]
Updated patch

Thank you for the guidance.
Yes, the header is found, here are the updated patches.

I looked at submitting the patches via a fork on gitlab, and I noticed two things:

1. I already had a fork, but https://gitlab.com/_wiz_/samba/-/commit/b5f69fd0508573895f47d515b6acdd15c16bc829 was not merged yet, would be nice to get that merged.

2. I can't clone the repository, git dies during the download of the objects:

ssh_dispatch_run_fatal: Connection to 2606:4700:90:0:f22e:fbec:5bed:a9b9 port 22: unknown error 28

happened three times in a row.