logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: funny action of crypt: msg#00037

Subject: Re: funny action of crypt
Philippe M. Chiasson wrote:
On Thu, 2004-03-04 at 14:21 -0800, Stas Bekman wrote:

Philippe M. Chiasson wrote:

On Wed, 2004-03-03 at 18:14 -0800, Stas Bekman wrote:


hara@xxxxxxxxxxx wrote:


Hi

I have a problem when my apache_1.3.29 w/ mod_perl 1.29 runs PerlRun
and some CGI scripts with password encryption.

Script is ...

$password = crypt($password, &mkSalt($name.$password.$value) );

[...]

mod_perl 2 has a workaround for 5.8.0:

/* This was fixed in 5.9.0/5.8.1 (17775), but won't compile after 19122 */
#if PERL_REVISION == 5 && PERL_VERSION == 8 && PERL_SUBVERSION == 0 && \
   defined(USE_REENTRANT_API) && defined(HAS_CRYPT_R) && defined(__GLIBC__)
   /* workaround perl5.8.0/glibc bug */
   PL_reentrant_buffer->_crypt_struct.current_saltbits = 0;
#endif

I haven't seen it in the mp1 code.


Is this workaround worth considering for backporting in mp1 ?

Looks like so. Hara has failed to respond back to the list and emailed me privately. And this did solve his problem after he stuck the above code somewhere in mod_perl.c. And yes, he was running 5.8.0.


Allright, I'll apply this fix to mp1 soon then.

I thought this had to do with threads... writing a test case that you can reproduce the problem with should be helpful. Could probably check the archives to find the discussion about the original report. The issue was with rand always starting from the same init value under threads. But I'm not sure how this affects a single interpreter-process.


--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxxxxxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


<Prev in Thread] Current Thread [Next in Thread>