summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-08-28 07:41:15 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-11 11:31:56 +0100
commit38fabe185d93ae5d993a2815f3d80d073779580d (patch)
treeefeeb9e4d0130c05a3211d34fa3017082122287d
parentb72dc78af6fdf175ef6a2866ed592434918f0147 (diff)
downloadpoky-38fabe185d93ae5d993a2815f3d80d073779580d.tar.gz
libnss-nis: Upgrade to 3.4
Bring following changes on top of 3.2 * 3c206b7 (origin/master, origin/HEAD) Release version 3.4 * 09f6be4 fix: Leak in nis-initgroups.c:_nss_nis_initgroups_dyn() * d141952 Release version 3.3 * 9a5fb67 Update autoconf files * f062d8e Remove nis-publickey.c Drop the lld patch, its fixed upstream by dropping the concerned code (From OE-Core rev: 1abf3ee8953cb50321c2817464117c3c7373f28d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/libnss-nis/libnss-nis/0001-make-ake-_nss_nis_getsecretkey-export-conditional-on.patch78
-rw-r--r--meta/recipes-extended/libnss-nis/libnss-nis_3.4.bb (renamed from meta/recipes-extended/libnss-nis/libnss-nis.bb)9
2 files changed, 2 insertions, 85 deletions
diff --git a/meta/recipes-extended/libnss-nis/libnss-nis/0001-make-ake-_nss_nis_getsecretkey-export-conditional-on.patch b/meta/recipes-extended/libnss-nis/libnss-nis/0001-make-ake-_nss_nis_getsecretkey-export-conditional-on.patch
deleted file mode 100644
index b9996d3292..0000000000
--- a/meta/recipes-extended/libnss-nis/libnss-nis/0001-make-ake-_nss_nis_getsecretkey-export-conditional-on.patch
+++ /dev/null
@@ -1,78 +0,0 @@
1From ecc9767fd8c3a1ecbfca5df18714df34995a38a3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 26 Aug 2025 22:45:54 -0700
4Subject: [PATCH] make: Make _nss_nis_getsecretkey export conditional on xdecrypt()
5
6The function _nss_nis_getsecretkey in nis-publickey.c is only
7compiled when xdecrypt() is available. This is controlled by the
8configure check AC_CHECK_FUNCS([xdecrypt]) which defines
9HAVE_XDECRYPT in config.h.
10
11However, the symbol was always listed in src/libnss_nis.map,
12regardless of whether the function was actually built. On systems
13without xdecrypt() (for example musl or certain embedded toolchains),
14this leads to a link failure:
15
16 ld: error: version script assignment of 'NSS_NIS_1.0' to symbol
17 '_nss_nis_getsecretkey' failed: symbol not defined
18
19To fix this mismatch, rename libnss_nis.map to
20libnss_nis.map.in and generate libnss_nis.map at build time:
21
22 - If HAVE_XDECRYPT is defined, the symbol map is copied unchanged.
23 - Otherwise, the _nss_nis_getsecretkey line is stripped out
24 with sed.
25
26Automake rules are added to src/Makefile.am so the correct
27libnss_nis.map is produced, and the linker always sees a version
28script consistent with the compiled objects.
29
30This ensures _nss_nis_getsecretkey is exported only when it exists
31in the object code, preventing build failures on platforms where
32xdecrypt() is missing.
33
34This fixes build with LLD linker which defaults to not accepting
35undefined symbols
36
37Upstream-Status: Submitted [https://github.com/thkukuk/libnss_nis/pull/12]
38Signed-off-by: Khem Raj <raj.khem@gmail.com>
39---
40 src/Makefile.am | 18 +++++++++++++++++-
41 src/{libnss_nis.map => libnss_nis.map.in} | 0
42 2 files changed, 17 insertions(+), 1 deletion(-)
43 rename src/{libnss_nis.map => libnss_nis.map.in} (100%)
44
45diff --git a/src/Makefile.am b/src/Makefile.am
46index e1a9bb2..cc32ea9 100644
47--- a/src/Makefile.am
48+++ b/src/Makefile.am
49@@ -22,8 +22,24 @@ nss_loader_test_LDADD = -ldl
50
51 TESTS = $(check_PROGRAMS)
52
53+# Build the version script from a template, pruning _nss_nis_getsecretkey
54+# when xdecrypt() was not detected by configure (i.e., HAVE_XDECRYPT is unset).
55+BUILT_SOURCES = libnss_nis.map
56+EXTRA_DIST += libnss_nis.map.in
57+CLEANFILES += libnss_nis.map
58+
59+libnss_nis.map: $(srcdir)/libnss_nis.map.in $(top_builddir)/config.h
60+ $(AM_V_GEN) { \
61+ if grep -q '^[[:space:]]*#define[[:space:]]\+HAVE_XDECRYPT[[:space:]]\+1' $(top_builddir)/config.h ; then \
62+ cp $(srcdir)/libnss_nis.map.in $@ ; \
63+ else \
64+ sed 's/ _nss_nis_getsecretkey;//g' \
65+ $(srcdir)/libnss_nis.map.in > $@ ; \
66+ fi ; \
67+ }
68+
69 libnss_nis_la_LDFLAGS = -version-info 2:0:0 \
70- -Wl,--version-script=$(srcdir)/libnss_nis.map
71+ -Wl,--version-script=$(builddir)/libnss_nis.map
72 libnss_nis_la_LIBADD = @LIBNSL_LIBS@
73 libnss_nis_la_SOURCES = nis-alias.c nis-ethers.c nis-grp.c nis-hosts.c \
74 nis-initgroups.c nis-netgrp.c nis-network.c \
75diff --git a/src/libnss_nis.map b/src/libnss_nis.map.in
76similarity index 100%
77rename from src/libnss_nis.map
78rename to src/libnss_nis.map.in
diff --git a/meta/recipes-extended/libnss-nis/libnss-nis.bb b/meta/recipes-extended/libnss-nis/libnss-nis_3.4.bb
index a7f6545be0..eac385f6d1 100644
--- a/meta/recipes-extended/libnss-nis/libnss-nis.bb
+++ b/meta/recipes-extended/libnss-nis/libnss-nis_3.4.bb
@@ -13,13 +13,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
13SECTION = "libs" 13SECTION = "libs"
14DEPENDS += "libtirpc libnsl2" 14DEPENDS += "libtirpc libnsl2"
15 15
16PV = "3.2" 16SRCREV = "3c206b762ac8557dab3c40ff3a297c9d1bff0d83"
17 17SRC_URI = "git://github.com/thkukuk/libnss_nis;branch=master;protocol=https;tag=v${PV}"
18SRCREV = "cd0d391af9535b56e612ed227c1b89be269f3d59"
19
20SRC_URI = "git://github.com/thkukuk/libnss_nis;branch=master;protocol=https \
21 file://0001-make-ake-_nss_nis_getsecretkey-export-conditional-on.patch \
22 "
23 18
24inherit autotools pkgconfig 19inherit autotools pkgconfig
25 20