pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/60344: net/samba4: export nss_module_register in libnss_winbind



>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)




Home | Main Index | Thread Index | Old Index