Hi,

thanks for the solution! This is much nicer than my fix of trimming
$sguser and $sgpasswd to 10 characters after crypt().

Cheers,
Ben

On Sat, 2002-06-08 at 23:29, Armand A. Verstappen wrote:
> On Thu, 2002-06-06 at 13:21, Ben Peter wrote:
> > Also, I cannot create the `company database' with MySQL 3.23.49, I
> have
> > filed a bug report at hklc.com/bugs, but there doesn't seem to be any
> > response. 
> 
> Your problem is triggered by a change in the php function crypt. It used
> to be a direct mapping to the unix crypt() call, but now will call the
> best hashing function the OS has available. This will cause the returned
> string to be longer than mysql can store. You can force the old crypt
> behaviour by specifying a two character salt.
> 
> your fix:
> 
> in Snippet: / hklc_adminsite_host / argv0 / dbsetup / dbsetup:
> 
> change
> 
> 25:         // new user!
> 26:         $sguser = eregi_replace("[^A-z0-9]","",crypt($sgguid));
> 27:     $sgpasswd = eregi_replace("[^A-z0-9]","",crypt($sguser));
> 28:     dbQuery("GRANT ALL PRIVILEGES ON ".$newdbname.".* TO
> ".$sguser."@localhost
> 29:            IDENTIFIED BY '". $sgpasswd ."' WITH GRANT OPTION");   
>  
> into
> 
> 25:         // new user!
> 26:         $sguser = eregi_replace("[^A-z0-9]","",crypt($sgguid,'Ab'));
> 27:     $sgpasswd = eregi_replace("[^A-z0-9]","",crypt($sguser,'Yz'));
> 28:     dbQuery("GRANT ALL PRIVILEGES ON ".$newdbname.".* TO
> ".$sguser."@localhost
> 29:            IDENTIFIED BY '". $sgpasswd ."' WITH GRANT OPTION"); 
> 
> (leaving the writing of a routine that provides random but valid salts
> as an excercise for the reader....)
> 
> wkr,
> 
> -- 
> Envida                     http://www.envida.net/
> Armand A. Verstappen       Graadt van Roggenweg 328
> [EMAIL PROTECTED]       3531 AH Utrecht
> tel: +31 (0)30 298 2255    Postbus 19127
> fax: +31 (0)30 298 2111    3501 DC Utrecht


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to