diff --git a/postfix-3.5.9-glibc-234-build-fix.patch b/postfix-3.5.9-glibc-234-build-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..32413620728cf6b3fb3d3195ac57ef9f06afb1b5 --- /dev/null +++ b/postfix-3.5.9-glibc-234-build-fix.patch @@ -0,0 +1,62 @@ +From e5e37549ef6244201c2fec69ae3e27ac4457403c Mon Sep 17 00:00:00 2001 +From: Weisson +Date: Tue, 30 Jan 2024 17:24:05 +0800 +Subject: [PATCH] postfix-3.5.9 glibc-234 build fix. + +Signed-off-by: Weisson +--- + src/util/sys_compat.c | 6 +++--- + src/util/sys_defs.h | 5 ++++- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/util/sys_compat.c b/src/util/sys_compat.c +index 8bf8e58..c87f043 100644 +--- a/src/util/sys_compat.c ++++ b/src/util/sys_compat.c +@@ -286,7 +286,7 @@ int dup2_pass_on_exec(int oldd, int newd) + + /* closefrom() - closes all file descriptors from the given one up */ + +-int closefrom(int lowfd) ++void closefrom(int lowfd) + { + int fd_limit = open_limit(0); + int fd; +@@ -298,14 +298,14 @@ int closefrom(int lowfd) + */ + if (lowfd < 0) { + errno = EBADF; +- return (-1); ++ return; + } + if (fd_limit > 500) + fd_limit = 500; + for (fd = lowfd; fd < fd_limit; fd++) + (void) close(fd); + +- return (0); ++ return; + } + + #endif +diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h +index 670929f..bbb9e20 100644 +--- a/src/util/sys_defs.h ++++ b/src/util/sys_defs.h +@@ -1509,10 +1509,13 @@ extern int setsid(void); + #endif + + #ifndef HAS_CLOSEFROM +-extern int closefrom(int); ++extern void closefrom(int); + + #endif + ++#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 34) ++#define HAS_CLOSEFROM ++#endif + #ifdef MISSING_STD_FILENOS + #define STDIN_FILENO 0 + #define STDOUT_FILENO 1 +-- +2.31.1 diff --git a/postfix.spec b/postfix.spec index 805c1bf9bb4b37b07a1c7dafe42aa1b5f6c8a6df..365aed35b70557ae7b558d48f24b40fa58d0619d 100644 --- a/postfix.spec +++ b/postfix.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # plugins have unresolvable symbols in compile time %undefine _strict_symbol_defs_build @@ -49,7 +50,7 @@ Name: postfix Summary: Postfix Mail Transport Agent Version: 3.5.8 -Release: 7%{?dist} +Release: 7%{anolis_release}%{?dist} Epoch: 2 Group: System Environment/Daemons URL: http://www.postfix.org @@ -110,6 +111,7 @@ Patch16: postfix-3.5.8-makedefs.patch # Optional patches - set the appropriate environment variables to include # them when building the package/spec file +Patch1000: postfix-3.5.9-glibc-234-build-fix.patch # Determine the different packages required for building postfix @@ -229,6 +231,10 @@ maps with Postfix, you need this. %patch3 -p1 -b .alternatives %patch4 -p1 -b .large-fs +%ifarch sw_64 +%patch1000 -p1 -b .closefrom +%endif + # Change DEF_SHLIB_DIR according to build host sed -i \ 's|^\(\s*#define\s\+DEF_SHLIB_DIR\s\+\)"/usr/lib/postfix"|\1"%{_libdir}/postfix"|' \ @@ -763,6 +769,9 @@ exit 0 %endif %changelog +* Tue Jan 30 2024 Weisson - 2:3.5.8-7.0.1 +- add glibc-2.34 support. + * Mon Aug 14 2023 Jaroslav Škarvada - 2:3.5.8-7 - Fixed possible warning when postfix is restarted Resolves: rhbz#2162659