Add patch to apply glibc bugfix if really needed only

This commit is contained in:
Björn Esser 2018-01-24 12:42:45 +01:00
parent e1a5a9a231
commit 13852f8c1b
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From f446736d4f4c5f7ae81bb8bf84fda7ce3c9d49a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Wed, 24 Jan 2018 12:37:48 +0100
Subject: [PATCH] unix/ngx_user: Apply fix for really old bug in glibc libcrypt
if needed
---
src/os/unix/ngx_user.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/os/unix/ngx_user.c b/src/os/unix/ngx_user.c
index 7ebe2b57..d0fe9238 100644
--- a/src/os/unix/ngx_user.c
+++ b/src/os/unix/ngx_user.c
@@ -21,8 +21,10 @@ ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
struct crypt_data cd;
cd.initialized = 0;
-#ifdef __GLIBC__
- /* work around the glibc bug */
+#if (defined(__GLIBC__) && __GLIBC__ == 2) && \
+ (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4)
+ /* work around glibc-2.2.5 bug,
+ * has been fixed at some time in glibc-2.3.X */
cd.current_salt[0] = ~salt[0];
#endif
--
2.16.1

View File

@ -17,7 +17,7 @@
Name: nginx
Epoch: 1
Version: 1.12.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: A high performance web server and reverse proxy server
Group: System Environment/Daemons
@ -44,6 +44,11 @@ Source210: UPGRADE-NOTES-1.6-to-1.10
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
Patch0: nginx-auto-cc-gcc.patch
# Apply fix for bug in glibc libcrypt, if needed only.
# That has been fixed some time in glibc-2.3.X and is
# not needed with libxcrypt anyways.
Patch1: 0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch
%if 0%{?with_gperftools}
BuildRequires: gperftools-devel
%endif
@ -173,6 +178,7 @@ Requires: nginx
%prep
%setup -q
%patch0 -p0
%patch1 -p1
cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} .
%if 0%{?rhel} > 0 && 0%{?rhel} < 8
@ -435,6 +441,9 @@ fi
%changelog
* Wed Jan 24 2018 Björn Esser <besser82@fedoraproject.org> - 1:1.12.1-5
- Add patch to apply glibc bugfix if really needed only
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1:1.12.1-4
- Rebuilt for switch to libxcrypt