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