aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_linux_config.h5
-rw-r--r--src/os/unix/ngx_user.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
index 5bad6451c..7bd262a19 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -88,6 +88,11 @@ extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
#endif
+#ifndef NGX_HAVE_GNU_CRYPT_R
+#define NGX_HAVE_GNU_CRYPT_R 1
+#endif
+
+
#ifndef NGX_HAVE_INHERITED_NONBLOCK
#define NGX_HAVE_INHERITED_NONBLOCK 0
#endif
diff --git a/src/os/unix/ngx_user.c b/src/os/unix/ngx_user.c
index 22eafd20e..cbb08a852 100644
--- a/src/os/unix/ngx_user.c
+++ b/src/os/unix/ngx_user.c
@@ -20,7 +20,7 @@
#if (NGX_CRYPT)
-#if (NGX_LINUX)
+#if (NGX_HAVE_GNU_CRYPT_R)
ngx_int_t
ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
@@ -33,6 +33,8 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
ngx_set_errno(0);
cd.initialized = 0;
+ /* work around the glibc-2.2.5 bug */
+ cd.current_saltbits = 0;
value = crypt_r((char *) key, (char *) salt, &cd);