From owner-freebsd-ports Sat Sep 12 01:06:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA11476 for freebsd-ports-outgoing; Sat, 12 Sep 1998 01:06:45 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from news1.gtn.com (news1.gtn.com [194.77.0.15]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA11468 for ; Sat, 12 Sep 1998 01:06:42 -0700 (PDT) (envelope-from andreas@klemm.gtn.com) Received: (from uucp@localhost) by news1.gtn.com (8.8.6/8.8.6) with UUCP id KAA17761; Sat, 12 Sep 1998 10:00:09 +0200 (MET DST) Received: (from andreas@localhost) by klemm.gtn.com (8.9.1/8.9.1) id JAA29731; Sat, 12 Sep 1998 09:42:47 +0200 (CEST) (envelope-from andreas) Message-ID: <19980912094245.A29717@klemm.gtn.com> Date: Sat, 12 Sep 1998 09:42:45 +0200 From: Andreas Klemm To: "Vladimir B. Grebenschikov" , stefan@asterix.webaffairs.net Cc: ports@FreeBSD.ORG, ibex@physik.TU-Berlin.DE Subject: Re: FreeBSD Port: apache-php3.0.3-1.3.0 References: <35F95FEF.F6A7C7B5@plugcom.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <35F95FEF.F6A7C7B5@plugcom.ru>; from Vladimir B. Grebenschikov on Fri, Sep 11, 1998 at 09:37:51PM +0400 X-Disclaimer: A free society is one where it is safe to be unpopular X-Operating-System: FreeBSD 3.0-CURRENT SMP Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi ! Dirk Froemberg is the new port maintainer. I didn't look closely into this ... if we add this patch, does it still work if installing FreeBSD with DES ? On Fri, Sep 11, 1998 at 09:37:51PM +0400, Vladimir B. Grebenschikov wrote: > php function CRYPT() need patch for propertly work with FreeBSD MD5 > passwords: > > > --- php-3.0.3.orig/functions/crypt.c Fri Sep 11 21:28:00 1998 > +++ php-3.0.3.orig/functions/crypt.c Fri Sep 11 20:55:25 1998 > @@ -66,9 +66,30 @@ > "Crypt", crypt_functions, NULL, NULL, NULL, NULL, NULL, > STANDARD_MODULE_PROPERTIES > }; > > +#ifdef __FreeBSD__ > +static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ > + > "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; > + > +void > +to64(s, v, n) > + char *s; > + long v; > + int n; > +{ > + while (--n >= 0) { > + *s++ = itoa64[v&0x3f]; > + v >>= 6; > + } > +} > +#endif > + > void php3_crypt(INTERNAL_FUNCTION_PARAMETERS) > { > +#ifdef __FreeBSD__ > + char salt[10]; > +#else > char salt[4]; > +#endif > int arg_count = ARG_COUNT(ht); > pval *arg1, *arg2; > static char seedchars[] = > @@ -83,14 +104,39 @@ > salt[0] = '\0'; > if (arg_count == 2) { > convert_to_string(arg2); > +#ifdef __FreeBSD__ > + strncpy(salt, arg2->value.str.val, 9); > +#else > strncpy(salt, arg2->value.str.val, 2); > +#endif > } > if (!salt[0]) { > +#ifdef __FreeBSD__ > +# ifdef NEWSALT > + salt[0] = '_'; > + (void)srandom((int)time((time_t *)NULL)); > + to64(&salt[1], random(), 4); > + to64(&salt[5], random(), 4); > +# else > + struct timeval tv; > + gettimeofday(&tv,0); > + /* MD5 Salt */ > + strncpy(&salt[0], "$1$", 3); > + to64(&salt[3], random(), 3); > + to64(&salt[6], tv.tv_usec, 3); > + salt[8] = '\0'; > +#endif > +#else > srand(time(0) * getpid()); > salt[0] = seedchars[rand() % 64]; > salt[1] = seedchars[rand() % 64]; > +#endif > } > +#ifdef __FreeBSD__ > + salt[9] = '\0'; > +#else > salt[2] = '\0'; > +#endif > > return_value->value.str.val = (char *) crypt(arg1->value.str.val, > salt); > return_value->value.str.len = strlen(return_value->value.str.val); /* > can be optimized away to 13? */ > > -- > > Plug Communication ISP, Moscow > Vladimir B. Grebenschikov, vova@plugcom.ru, 2:5020/302@fidonet.org > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-ports" in the body of the message -- Andreas Klemm http://www.FreeBSD.ORG/~andreas What gives you 90% more speed, for example, in kernel compilation ? http://www.FreeBSD.ORG/~fsmp/SMP/akgraph-a/graph1.html "NT = Not Today" (Maggie Biggs) ``powered by FreeBSD SMP'' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message