Creating md5 passwords in PHP for the PostgreSQL pg_shadow table

From: Matthew Horoschun <mhoroschun(at)canprint(dot)com(dot)au>
To: pgsql-php(at)postgresql(dot)org
Subject: Creating md5 passwords in PHP for the PostgreSQL pg_shadow table
Date: 2003-01-20 11:37:42
Message-ID: 9630758A-2C6B-11D7-9E46-000393B3A702@canprint.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi All,

I want to be able to allow non-superusers the ability to create other
PostgreSQL users in limited circumstances. My plan was to create a
dummy table with rules that actually made changes to the pg_shadow
table.

Therefore I need to be able to create password entries in the pg_shadow
table. From browsing the code and the mailing lists I'm pretty certain
I need to do the following in PHP to create a MD5 password for
PostgreSQL:

$passwd = "md5" . md5( md5( $password . $username ) . $salt );

Has anybody done this before? Is this the right way to get the md5?...
and if so... how do I get PostgreSQL to give me the salt?

Thanks in advance for any assistance!

Cheers

Matthew.

--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.

Mobile: 0417 282 378
Direct: (02) 6295 4544
Telephone: (02) 6295 4422
Facsimile: (02) 6295 4473

Browse pgsql-php by date

  From Date Subject
Next Message Matthew Horoschun 2003-01-20 22:10:16 Re: Creating md5 passwords in PHP for the PostgreSQL pg_shadow table
Previous Message David Busby 2003-01-06 18:18:33 Re: pg_field_size