aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_user.c')
-rw-r--r--src/os/unix/ngx_user.c4
1 files changed, 3 insertions, 1 deletions
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);