ignatenkobrain / rpms / nginx

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