diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-15 03:16:31 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-16 00:29:43 -0400 |
commit | 3dca923591752bf0e43869e50ebba8bc5b71f7c6 (patch) | |
tree | 88a1858e55da046badb07ed8dfac02f2c283e587 /src/mod_authn_file.c | |
parent | fed2ecae19a5eacd8a973d0788a96b27fd1778d1 (diff) | |
download | lighttpd-git-3dca923591752bf0e43869e50ebba8bc5b71f7c6.tar.gz |
[mod_authn_mysql,file] use crypt() to save stack
use crypt() instead of crypt_r() to save stack space,
as struct crypt_data might be very large.
While crypt() is not thread-safe, lighttpd is single-threaded
Diffstat (limited to 'src/mod_authn_file.c')
-rw-r--r-- | src/mod_authn_file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mod_authn_file.c b/src/mod_authn_file.c index d193eb58..a4a0fd47 100644 --- a/src/mod_authn_file.c +++ b/src/mod_authn_file.c @@ -628,7 +628,7 @@ static handler_t mod_authn_file_htpasswd_basic(request_st * const r, void *p_d, /* a simple DES password is 2 + 11 characters. everything else should be longer. */ else if (buffer_string_length(password) >= 13) { char *crypted; - #if defined(HAVE_CRYPT_R) + #if 0 && defined(HAVE_CRYPT_R) struct crypt_data crypt_tmp_data; #ifdef _AIX memset(&crypt_tmp_data, 0, sizeof(crypt_tmp_data)); @@ -676,7 +676,7 @@ static handler_t mod_authn_file_htpasswd_basic(request_st * const r, void *p_d, memcpy(sample, "$1$", sizeof("$1$")-1); memcpy(sample+sizeof("$1$")-1, b, slen); sample[sizeof("$1$")-1+slen] = '\0'; - #if defined(HAVE_CRYPT_R) + #if 0 && defined(HAVE_CRYPT_R) crypted = crypt_r(ntlmhex, sample, &crypt_tmp_data); #else crypted = crypt(ntlmhex, sample); @@ -690,7 +690,7 @@ static handler_t mod_authn_file_htpasswd_basic(request_st * const r, void *p_d, else #endif { - #if defined(HAVE_CRYPT_R) + #if 0 && defined(HAVE_CRYPT_R) crypted = crypt_r(pw, password->ptr, &crypt_tmp_data); #else crypted = crypt(pw, password->ptr); |