0001-unix-ngx_user-Apply-fix-for-really-old-bug-in-glibc-.patch 993 B

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