Creating md5 passwords in PHP for the PostgreSQL pg_shadow table - Mailing list pgsql-php

From Matthew Horoschun
Subject Creating md5 passwords in PHP for the PostgreSQL pg_shadow table
Date
Msg-id 9630758A-2C6B-11D7-9E46-000393B3A702@canprint.com.au
Whole thread Raw
List 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


pgsql-php by date:

Previous
From: "David Busby"
Date:
Subject: Re: pg_field_size
Next
From: Matthew Horoschun
Date:
Subject: Re: Creating md5 passwords in PHP for the PostgreSQL pg_shadow table