Compare commits

...

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

2
.gitignore vendored

@ -1 +1 @@
SOURCES/v2.18.1.tar.gz
SOURCES/nss-altfiles-2.23.0.tar.gz

@ -1 +1 @@
65ca705337cee4b1042896709cb5b537874e672e SOURCES/v2.18.1.tar.gz
dec35095f974b6dbe460c770443c0e70cbeb1b56 SOURCES/nss-altfiles-2.23.0.tar.gz

@ -1,40 +1,38 @@
From a4ba0ead6c82b3efe409c04d17de7ca06054356a Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Wed, 3 Oct 2018 15:11:52 +0000
Subject: [PATCH] build-sys: Inherit LDFLAGS
commit b87b28953cee248cffe05c8fd07d4a812a077e0d
Author: Jan Pazdziora <jpazdziora@redhat.com>
Date: Fri Dec 31 14:39:18 2021 +0100
So that we can respect e.g. the Fedora hardening flags.
---
Makefile | 2 +-
configure | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
build-sys: Inherit LDFLAGS
So that we can respect e.g. the Fedora hardening flags.
diff --git a/Makefile b/Makefile
index 8d9b7d2..badecdc 100644
index ea35529..f810fce 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ O := files-pwd.o \
files-have_o_cloexec.o
@@ -23,7 +23,7 @@ O := $(if $(HANDLE_rpc), src/nss_altfiles/files-rpc.o) \
src/nss_altfiles/files-have_o_cloexec.o
CFLAGS += $(EXTRA_CFLAGS) -pthread -fpic
-LDFLAGS += $(CFLAGS) -Wl,-soname,$T -Wl,-as-needed -nostdlib -lpthread
+LDFLAGS += $(CFLAGS) $(EXTRA_LDFLAGS) -Wl,-soname,$T -Wl,-as-needed -nostdlib -lpthread
CFLAGS += $(EXTRA_CFLAGS) -pthread -fpic -std=gnu99 -Wall
-LDFLAGS += $(CFLAGS) -Wl,-soname,$T -Wl,-as-needed -lpthread
+LDFLAGS += $(CFLAGS) $(EXTRA_LDFLAGS) -Wl,-soname,$T -Wl,-as-needed -lpthread
CPPFLAGS += -D_GNU_SOURCE
ifneq ($(strip $(DATADIR)),)
diff --git a/configure b/configure
index 3336c3d..8d0bf6d 100755
index 2b45e0b..74695b0 100755
--- a/configure
+++ b/configure
@@ -34,13 +34,14 @@ done
#
test -n "${CXXFLAGS}" && EXTRA_CXXFLAGS=${CXXFLAGS}
test -n "${CFLAGS}" && EXTRA_CFLAGS=${CFLAGS}
+test -n "${LDFLAGS}" && EXTRA_LDFLAGS=${LDFLAGS}
@@ -37,6 +37,7 @@ for var in "$@" ; do
CFLAGS Additional command line flags to be passed to the C compiler
CXXFLAGS Additional command line flags to be passed to the C++ compiler
+ LDFLAGS Additional command line flags to be passed to the linker
NOTE: This script tries to mimic the typical usage for configure scripts
generated by autotools, hence it will silently ignore unrecognized
@@ -54,7 +55,7 @@ echo EXTRA_CXXFLAGS= >> config.mk
# Inspect arguments and generate config.mk
#
echo "# autogenerated by: $0 $*" > config.mk
for var in "$@" ; do
case ${var} in
- CFLAGS=* | CXXFLAGS=*)
@ -42,6 +40,13 @@ index 3336c3d..8d0bf6d 100755
echo "Setting EXTRA_${var}"
echo "EXTRA_${var}" >> config.mk
;;
--
2.17.1
@@ -107,5 +108,9 @@ if test -n "${CXXFLAGS}"; then
echo "Setting EXTRA_CXXFLAGS+=${CXXFLAGS} (from environment)"
echo "EXTRA_CXXFLAGS+=${CXXFLAGS}" >> config.mk
fi
+if test -n "${LDFLAGS}"; then
+ echo "Setting EXTRA_LDFLAGS+=${LDFLAGS} (from environment)"
+ echo "EXTRA_LDFLAGS+=${LDFLAGS}" >> config.mk
+fi
echo "config.mk written"

@ -0,0 +1,106 @@
commit de2b32289bf701ce3c8167a1b58436866922085e
Author: Tan Shen Joon <shen.joon.tan@intel.com>
Date: Thu Aug 15 10:43:34 2019 +0800
deprecate RES_USE_INET6
Following the remove of RES_USE_INET6, this patch
is cherry picked from glibc patch to adopt the similar
fix
https://sourceware.org/git/?p=glibc.git;a=commit;h=9c02d0784dfa0bb4b0bfec4fb6db35d3ea953288
Signed-off-by: Tan Shen Joon <shen.joon.tan@intel.com>
diff --git a/src/nss_altfiles/files-hosts.c b/src/nss_altfiles/files-hosts.c
index 65661d8..8d31a1f 100644
--- a/src/nss_altfiles/files-hosts.c
+++ b/src/nss_altfiles/files-hosts.c
@@ -33,8 +33,8 @@
#define DATABASE "hosts"
#define NEED_H_ERRNO
-#define EXTRA_ARGS , af, flags
-#define EXTRA_ARGS_DECL , int af, int flags
+#define EXTRA_ARGS , af
+#define EXTRA_ARGS_DECL , int af
#define ENTDATA hostent_data
struct hostent_data
@@ -59,12 +59,7 @@ LINE_PARSER
af = af == AF_UNSPEC ? AF_INET : af;
else
{
- if (af == AF_INET6 && (flags & AI_V4MAPPED) != 0
- && inet_pton (AF_INET, addr, entdata->host_addr) > 0)
- map_v4v6_address ((char *) entdata->host_addr,
- (char *) entdata->host_addr);
- else if (af == AF_INET
- && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
{
if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr))
memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ);
@@ -97,16 +92,13 @@ LINE_PARSER
STRING_FIELD (result->h_name, isspace, 1);
})
-#define EXTRA_ARGS_VALUE \
- , ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), \
- ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)
+#define EXTRA_ARGS_VALUE , AF_INET
#include "files-XXX.c"
#undef EXTRA_ARGS_VALUE
/* We only need to consider IPv4 mapped addresses if the input to the
gethostbyaddr() function is an IPv6 address. */
-#define EXTRA_ARGS_VALUE \
- , af, (len == IN6ADDRSZ ? AI_V4MAPPED : 0)
+#define EXTRA_ARGS_VALUE , af
DB_LOOKUP (hostbyaddr, ,,,
{
if (result->h_length == (int) len
@@ -130,12 +122,8 @@ ALTFILES_SYMBOL1(_gethostbyname3_r) (const char *name, int af, struct hostent *r
if (status == NSS_STATUS_SUCCESS)
{
- /* XXX Is using _res to determine whether we want to convert IPv4
- addresses to IPv6 addresses really the right thing to do? */
- int flags = ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0);
-
while ((status = internal_getent (stream, result, buffer, buflen, errnop,
- herrnop, af, flags))
+ herrnop, af))
== NSS_STATUS_SUCCESS)
{
LOOKUP_NAME_CASE (h_name, h_aliases)
@@ -162,8 +150,7 @@ ALTFILES_SYMBOL1(_gethostbyname3_r) (const char *name, int af, struct hostent *r
again:
while ((status = internal_getent (stream, &tmp_result_buf, tmp_buffer,
- tmp_buflen, errnop, herrnop, af,
- flags))
+ tmp_buflen, errnop, herrnop, af))
== NSS_STATUS_SUCCESS)
{
int matches = 1;
@@ -351,9 +338,7 @@ ALTFILES_SYMBOL1(_gethostbyname_r) (const char *name, struct hostent *result,
char *buffer, size_t buflen, int *errnop,
int *herrnop)
{
- int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
-
- return ALTFILES_SYMBOL1(_gethostbyname3_r) (name, af, result, buffer, buflen,
+ return ALTFILES_SYMBOL1(_gethostbyname3_r) (name, AF_INET, result, buffer, buflen,
errnop, herrnop, NULL, NULL);
}
@@ -390,7 +375,7 @@ ALTFILES_SYMBOL1(_gethostbyname4_r) (const char *name, struct gaih_addrtuple **p
struct hostent result;
status = internal_getent (stream, &result, buffer, buflen, errnop,
- herrnop, AF_UNSPEC, 0);
+ herrnop, AF_UNSPEC);
if (status != NSS_STATUS_SUCCESS)
break;

@ -1,18 +1,13 @@
%global commit 89f3f0b390f3bbc58d8964b11a517173ed4eed78
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Summary: NSS module to look up users in /usr/lib/passwd too
Summary: NSS module to look up from files in /usr/lib as well
Name: nss-altfiles
Version: 2.18.1
Release: 20%{?dist}
#VCS: https://github.com/aperezdc/nss-altfiles
Source0: https://github.com/aperezdc/nss-altfiles/archive/v%{version}.tar.gz
# From pull request: https://github.com/marineam/nss-altfiles/commit/dda5073238b88b4537f2d2707b0ef67bdd11fe06
# FIXME: Change nss-altfiles to not use glibc internal symbols
#Patch0: 0001-Explicitly-link-to-libc.patch
Version: 2.23.0
Release: 5%{?dist}
Source0: https://github.com/flatcar/nss-altfiles/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch1: 0001-build-sys-Inherit-LDFLAGS.patch
License: LGPLv2+
URL: https://github.com/aperezdc/nss-altfiles
# From https://github.com/flatcar/nss-altfiles/commit/de2b32289bf701ce3c8167a1b58436866922085e
Patch2: 0003-deprecate-RES_USE_INET6.patch
License: LGPL-2.1-or-later and MIT
URL: https://github.com/flatcar/nss-altfiles
BuildRequires: make
BuildRequires: glibc-devel
@ -21,13 +16,13 @@ BuildRequires: git
%description
When installed, this package allows looking up users
in %{prefix}/lib/passwd, similarly, groups in %{prefix}/lib/group.
in %{prefix}/lib/passwd, and from respective files for all other NSS maps.
%prep
%autosetup -Sgit
%build
./configure --prefix=%{_prefix} --libdir=%{_libdir} CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}"
./configure --with-types=all --prefix=%{_prefix} --libdir=%{_libdir} CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}"
make %{?_smp_mflags}
%install
@ -40,8 +35,38 @@ make install DESTDIR=$RPM_BUILD_ROOT
%ldconfig_scriptlets
%changelog
* Mon Aug 02 2021 Colin Walters <walters@verbum.org> - 2.18.1-20
- Pointless rebuild to re-trigger gating etc
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2.23.0-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.23.0-4
- Rebuilt for MSVSphere 10
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.23.0-4
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.23.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.23.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Jan Pazdziora <jpazdziora@redhat.com> - 2.23.0-1
- Rebase to 2.23.0 (fedora#2036375)
- Change upstream to https://github.com/flatcar/nss-altfiles
- Enable all maps (fedora#2036375)
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.1-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.1-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.1-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.18.1-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

Loading…
Cancel
Save