Blame SOURCES/0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch

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