Not really sure where to put this, we don't have a "bugs" section at the moment - or do we?

Anyway, this came up yesterday and it took me a couple of hours to nail down, so I thought a relevantly titled node might be useful in the archive.

Issue: crypt() under mod_perl acts erratically on systems with glibc 2.2.15 (in my case, Mandrake 9.0).

Temporary, ugly solution: Run crypt through backticks, ie:

# change my $crypted = crypt($string,$salt); # to my $crypted = `perl -e "print crypt($string,$salt)"`;

If anyone's found a neater workaround, feel free to share :)

.02

cLive ;-)

Replies are listed 'Best First'.
Re: (OT?) mod_perl crypt() + glibc 2.2.15 bug
by chromatic (Archbishop) on Nov 19, 2002 at 21:37 UTC

    What do you mean "erratically"? What do the Perl tests for crypt say when you run them verbosely? Are you running into an issue where all of the mod_perl children share the same srand seed?

      Nah, I'm far too lazy/busy to spend time hammering out the exact issue. I found a post here that mentioned it. I also found another post somewhere saying it had come up as a bug on a glibc mailing list and was being/had been dealt with (unfortunately, I can't find that page now).

      I was under the impression it was glibc, but now I can't find the original thread, I'm not so sure.

      Either way, the fix works and is a quick solution for anyone else who's had to deal with the same issue quickly.

      .02

      cLive ;-)