NetBSD Problem Report #60344
From www@netbsd.org Sat Jun 20 15:45:45 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "R13" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 139111A923C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 20 Jun 2026 15:45:45 +0000 (UTC)
Message-Id: <20260620154544.0D2BE1A923D@mollari.NetBSD.org>
Date: Sat, 20 Jun 2026 15:45:43 +0000 (UTC)
From: bartosz.kuzma@gmail.com
Reply-To: bartosz.kuzma@gmail.com
To: gnats-bugs@NetBSD.org
Subject: net/samba4: export nss_module_register in libnss_winbind
X-Send-Pr-Version: www-1.0
X-From4GNATS: "bartosz.kuzma@gmail.com via gnats" <gnats-admin@NetBSD.org>
>Number: 60344
>Category: pkg
>Synopsis: net/samba4: export nss_module_register in libnss_winbind
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jun 20 15:50:00 +0000 2026
>Originator: Bartosz Kuzma
>Release: pkgsrc-2026Q1
>Organization:
>Environment:
NetBSD 11.0_RC5
>Description:
To use libnss_winbind.so with NetBSD it should export GLOBAL function nss_module_register to be used by nsdispatch(3).
nsswitch.conf with winbind source from net/samba4 build from pkgsrc-2026Q1 does not work and readelf shows:
# readelf -s /usr/lib/nss_winbind.so.0 | grep nss_module_register
144: 0000000000006e35 62 FUNC LOCAL DEFAULT 9 nss_module_register
After applying the attached patch:
# readelf -s /usr/lib/nss_winbind.so.0 | grep nss_module_register
20: 0000000000006e25 21 FUNC GLOBAL DEFAULT 9 nss_module_register
314: 0000000000006e25 21 FUNC GLOBAL DEFAULT 9 nss_module_register
After this change getent passwd and getent group with winbind source work correctly.
I believe this pkgsrc-users thread describes the same problem: https://mail-index.netbsd.org/pkgsrc-users/2022/11/14/msg036477.html
>How-To-Repeat:
>Fix:
Index: patches/patch-nsswitch_winbind__nss__netbsd.c
===================================================================
RCS file: /cvsroot/pkgsrc/net/samba4/patches/patch-nsswitch_winbind__nss__netbsd.c,v
retrieving revision 1.3
diff -u -r1.3 patch-nsswitch_winbind__nss__netbsd.c
--- patches/patch-nsswitch_winbind__nss__netbsd.c 10 Jan 2024 08:39:30 -0000 1.3
+++ patches/patch-nsswitch_winbind__nss__netbsd.c 20 Jun 2026 15:27:17 -0000
@@ -1,8 +1,9 @@
-$NetBSD: patch-nsswitch_winbind__nss__netbsd.c,v 1.3 2024/01/10 08:39:30 adam Exp $
+$NetBSD$
Add primary group support
+Export nss_module_register function for nsdispatch
---- nsswitch/winbind_nss_netbsd.c.orig 2024-01-08 14:34:28.213466000 +0000
+--- nsswitch/winbind_nss_netbsd.c.orig 2025-08-27 04:50:28.248968400 +0000
+++ nsswitch/winbind_nss_netbsd.c
@@ -176,6 +176,7 @@ netbsdwinbind_getgroupmembership(void *n
{
@@ -26,3 +27,11 @@
strncpy(request.data.username, uname,
sizeof(request.data.username) - 1);
i = winbindd_request_response(NULL, WINBINDD_GETGROUPS,
+@@ -393,6 +401,7 @@ static ns_mtab winbind_methods[] = {
+
+ };
+
++__attribute__((visibility("default")))
+ ns_mtab *
+ nss_module_register(const char *source, unsigned int *mtabsize,
+ nss_module_unregister_fn *unreg)
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.