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