diff --git a/0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch b/0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch new file mode 100644 index 0000000..4868b3d --- /dev/null +++ b/0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch @@ -0,0 +1,30 @@ +From f446736d4f4c5f7ae81bb8bf84fda7ce3c9d49a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +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 + diff --git a/nginx.spec b/nginx.spec index 244c650..dfaa151 100644 --- a/nginx.spec +++ b/nginx.spec @@ -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 - 1:1.12.1-5 +- Add patch to apply glibc bugfix if really needed only + * Sat Jan 20 2018 Björn Esser - 1:1.12.1-4 - Rebuilt for switch to libxcrypt