Skip to content

Commit fbab4fb

Browse files
committed
Add patch to fix test on nginx proxy
1 parent 69afd42 commit fbab4fb

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ AC_ARG_WITH([proxy_version], [AS_HELP_STRING([--with-proxy-version],
3636
[proxy version to output])],
3737
[PROXY_VERSION=$withval], [PROXY_VERSION=libnginx-mod-redirectionio:dev])
3838

39-
PATCH_FILES=
39+
PATCH_FILES="patches/glibc_bug_fixed.patch"
4040

4141
AC_ARG_ENABLE([debian-header],
4242
AS_HELP_STRING([--enable-debian-header], [Patch nginx source with the debian header patch.]), [

patches/glibc_bug_fixed.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 1ef5c9ce6f03907dad1677d25f108d2bf59a5c15 Mon Sep 17 00:00:00 2001
2+
From: Maxim Dounin <[email protected]>
3+
Date: Wed, 23 May 2018 16:38:16 +0300
4+
Subject: [PATCH] Removed glibc crypt_r() bug workaround (ticket #1469).
5+
6+
The bug in question was fixed in glibc 2.3.2 and is no longer expected
7+
to manifest itself on real servers. On the other hand, the workaround
8+
causes compilation problems on various systems. Previously, we've
9+
already fixed the code to compile with musl libc (fd6fd02f6a4d), and
10+
now it is broken on Fedora 28 where glibc's crypt library was replaced
11+
by libxcrypt. So the workaround was removed.
12+
---
13+
src/os/unix/ngx_user.c | 4 ----
14+
1 file changed, 4 deletions(-)
15+
16+
diff --git a/src/os/unix/ngx_user.c b/src/os/unix/ngx_user.c
17+
index 7ebe2b576c..b3d81d07b7 100644
18+
--- a/src/os/unix/ngx_user.c
19+
+++ b/src/os/unix/ngx_user.c
20+
@@ -21,10 +21,6 @@ ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
21+
struct crypt_data cd;
22+
23+
cd.initialized = 0;
24+
-#ifdef __GLIBC__
25+
- /* work around the glibc bug */
26+
- cd.current_salt[0] = ~salt[0];
27+
-#endif
28+
29+
value = crypt_r((char *) key, (char *) salt, &cd);

0 commit comments

Comments
 (0)