Support for md5 crypt().
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=569
Reported by @grubba
From: Daniel Podlejski <underley@underley.eu.org>
To: pike@idonex.se
Date: Tue, 17 Oct 2000 20:57:07 +0200
Subject: md5 crypt() patch
Hi,
following patch provide md5 crypt function on systems with md5 paswords support.
--- src/builtin_functions.c.orig Tue Oct 17 19:56:50 2000 +++ src/builtin_functions.c Tue Oct 17 20:54:50 2000 @@ -1634,7 +1634,7 @@
PMOD_EXPORT void f_crypt(INT32 args)
{
- char salt[2];
+ char salt[6] = "$1$..\0";
char *ret, *saltp;
char *choise =
"cbhisjKlm4k65p7qrJfLMNQOPxwzyAaBDFgnoWXYCZ0123tvdHueEGISRTUV89./";
@@ -1660,9 +1660,9 @@
} else {
unsigned int foo; /* Sun CC want's this :( */
foo=my_rand();
- salt[0] = choise[foo % (size_t) strlen(choise)];
+ salt[3] = choise[foo % (size_t) strlen(choise)];
foo=my_rand();
- salt[1] = choise[foo % (size_t) strlen(choise)];
+ salt[4] = choise[foo % (size_t) strlen(choise)];
saltp=salt;
}
#ifdef HAVE_CRYPT
-- Daniel Podlejski underley@underley.eu.org ... The second hellrider came From flaming seas and molten sands ...