pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PQconnectdb question and  md5 password
7+ messages / 3 participants
[nested] [flat]

* PQconnectdb question and  md5 password
@ 2008-05-06 10:07 Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Guy Deleeuw @ 2008-05-06 10:07 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I don't know how can I pass a md5 password to the password field ?
example :
connInfo = "host=localhost port=5432 dbname=db_stats user=postgres 
password=secret";
  pConn = PQconnectdb(connInfo);

I try to replace the string 'secret' by the content of /etc/shadow but 
without succès.

Thanks in advance

Guy



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and  md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
@ 2008-05-06 17:13 ` Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 17:58   ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  0 siblings, 1 reply; 7+ messages in thread

From: Marcelo Martins @ 2008-05-06 17:13 UTC (permalink / raw)
  To: Guy Deleeuw <G.De_Leeuw@eurofer.be>; +Cc: pgsql-admin

How do you have your pg_hba.conf file setup ?

If on the shell as the postgres user, you can login into the   
"db_stats" database without a password being asked for than you should  
not need one.
Try out:

postgres$> psql db_stats

and see if you can login without asking for a PW.. check your  
pg_hba.conf first though.


On May 6, 2008, at 5:07 AM, Guy Deleeuw wrote:

> Hello,
>
> I don't know how can I pass a md5 password to the password field ?
> example :
> connInfo = "host=localhost port=5432 dbname=db_stats user=postgres  
> password=secret";
> pConn = PQconnectdb(connInfo);
>
> I try to replace the string 'secret' by the content of /etc/shadow  
> but without succès.
>
> Thanks in advance
>
> Guy
>
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and  md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
@ 2008-05-06 17:58   ` Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 18:11     ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Guy Deleeuw @ 2008-05-06 17:58 UTC (permalink / raw)
  To: Marcelo Martins <pglists@zeroaccess.org>; +Cc: pgsql-admin

Hello Marcelo,
Thanks for your respons

I have a password and is what I need.
My pg_hba.conf have 'md5' :
host    all         all         127.0.0.1/32          md5

My question are just how I can connect from the C api with an md5 
password or it's not possible ?

Regards
Guy

Marcelo Martins a écrit :
> How do you have your pg_hba.conf file setup ?
>
> If on the shell as the postgres user, you can login into the  
> "db_stats" database without a password being asked for than you should 
> not need one.
> Try out:
>
> postgres$> psql db_stats
>
> and see if you can login without asking for a PW.. check your 
> pg_hba.conf first though.
>
>
> On May 6, 2008, at 5:07 AM, Guy Deleeuw wrote:
>
>> Hello,
>>
>> I don't know how can I pass a md5 password to the password field ?
>> example :
>> connInfo = "host=localhost port=5432 dbname=db_stats user=postgres 
>> password=secret";
>> pConn = PQconnectdb(connInfo);
>>
>> I try to replace the string 'secret' by the content of /etc/shadow 
>> but without succès.
>>
>> Thanks in advance
>>
>> Guy
>>
>> -- 
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>
>

-- 
Guy De Leeuw
IT Manager
Eurofer
5, avenue Ariane
Building "Integrale" (3rd floor)
1200, Bruxelles
Belgium
Phone : +32 (2) 738 79 40
Mobile : 00 32 498 93 65 00
Fax : +32 (2) 736 28 22
E-Mail : mailto:G.De_Leeuw@eurofer.be
www : http://www.eurofer.org





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and  md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 17:58   ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
@ 2008-05-06 18:11     ` Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 18:30       ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  0 siblings, 1 reply; 7+ messages in thread

From: Marcelo Martins @ 2008-05-06 18:11 UTC (permalink / raw)
  To: Guy Deleeuw <G.De_Leeuw@eurofer.be>; +Cc: pgsql-admin

Hi Gus,

You should be able to, I'm not a C guru but on perl I can without any  
issues.
Did you setup a password for the postgres user account in postgreSQL  
itself ?
I found strange that you were trying out the password from /etc/shadow  
file though.

 > ALTER USER postgres WITH ENCRYPTED PASSWORD 'secret';

What error the postgres log gives you ?


On May 6, 2008, at 12:58 PM, Guy Deleeuw wrote:

> Hello Marcelo,
> Thanks for your respons
>
> I have a password and is what I need.
> My pg_hba.conf have 'md5' :
> host    all         all         127.0.0.1/32          md5
>
> My question are just how I can connect from the C api with an md5  
> password or it's not possible ?
>
> Regards
> Guy
>
> Marcelo Martins a écrit :
>> How do you have your pg_hba.conf file setup ?
>>
>> If on the shell as the postgres user, you can login into the   
>> "db_stats" database without a password being asked for than you  
>> should not need one.
>> Try out:
>>
>> postgres$> psql db_stats
>>
>> and see if you can login without asking for a PW.. check your  
>> pg_hba.conf first though.
>>
>>
>> On May 6, 2008, at 5:07 AM, Guy Deleeuw wrote:
>>
>>> Hello,
>>>
>>> I don't know how can I pass a md5 password to the password field ?
>>> example :
>>> connInfo = "host=localhost port=5432 dbname=db_stats user=postgres  
>>> password=secret";
>>> pConn = PQconnectdb(connInfo);
>>>
>>> I try to replace the string 'secret' by the content of /etc/shadow  
>>> but without succès.
>>>
>>> Thanks in advance
>>>
>>> Guy
>>>
>>> -- 
>>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-admin
>>
>>
>
> -- 
> Guy De Leeuw
> IT Manager
> Eurofer
> 5, avenue Ariane
> Building "Integrale" (3rd floor)
> 1200, Bruxelles
> Belgium
> Phone : +32 (2) 738 79 40
> Mobile : 00 32 498 93 65 00
> Fax : +32 (2) 736 28 22
> E-Mail : mailto:G.De_Leeuw@eurofer.be
> www : http://www.eurofer.org
>
>




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and  md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 17:58   ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 18:11     ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
@ 2008-05-06 18:30       ` Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 19:25         ` Re: PQconnectdb question and md5 password Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Guy Deleeuw @ 2008-05-06 18:30 UTC (permalink / raw)
  To: Marcelo Martins <pglists@zeroaccess.org>; +Cc: pgsql-admin

Gus ? :-)

No I need to put the md5 string into the connInfo, just that.
the other parts work fine

Guy
Marcelo Martins a écrit :
> Hi Gus,
>
> You should be able to, I'm not a C guru but on perl I can without any 
> issues.
> Did you setup a password for the postgres user account in postgreSQL 
> itself ?
> I found strange that you were trying out the password from /etc/shadow 
> file though.
>
> > ALTER USER postgres WITH ENCRYPTED PASSWORD 'secret';
>
> What error the postgres log gives you ?
>
>
> On May 6, 2008, at 12:58 PM, Guy Deleeuw wrote:




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 17:58   ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 18:11     ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 18:30       ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
@ 2008-05-06 19:25         ` Tom Lane <tgl@sss.pgh.pa.us>
  2008-05-06 19:56           ` Re: PQconnectdb question and md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2008-05-06 19:25 UTC (permalink / raw)
  To: Guy Deleeuw <G.De_Leeuw@eurofer.be>; +Cc: Marcelo Martins <pglists@zeroaccess.org>; pgsql-admin

Guy Deleeuw <G.De_Leeuw@eurofer.be> writes:
> No I need to put the md5 string into the connInfo, just that.

No, you need to put the plain text of the password into the connInfo.
Knowing the md5 doesn't prove you know the password.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: PQconnectdb question and md5 password
  2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 17:13 ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 17:58   ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 18:11     ` Re: PQconnectdb question and  md5 password Marcelo Martins <pglists@zeroaccess.org>
  2008-05-06 18:30       ` Re: PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
  2008-05-06 19:25         ` Re: PQconnectdb question and md5 password Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-05-06 19:56           ` Guy Deleeuw <G.De_Leeuw@eurofer.be>
  0 siblings, 0 replies; 7+ messages in thread

From: Guy Deleeuw @ 2008-05-06 19:56 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Marcelo Martins <pglists@zeroaccess.org>; pgsql-admin

Hello Tom


> No, you need to put the plain text of the password into the connInfo.
> Knowing the md5 doesn't prove you know the password.
>
> 			regards, tom lane
>   
I just try to cancel the easy way to "string" the binary and extract the 
password from my app.
A solution are to put the md5 string and not the clear password.
but if it's not possible, a follow another way.

Thanks for your respons.

Regards
Guy



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2008-05-06 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-05-06 10:07 PQconnectdb question and  md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>
2008-05-06 17:13 ` Marcelo Martins <pglists@zeroaccess.org>
2008-05-06 17:58   ` Guy Deleeuw <G.De_Leeuw@eurofer.be>
2008-05-06 18:11     ` Marcelo Martins <pglists@zeroaccess.org>
2008-05-06 18:30       ` Guy Deleeuw <G.De_Leeuw@eurofer.be>
2008-05-06 19:25         ` Re: PQconnectdb question and md5 password Tom Lane <tgl@sss.pgh.pa.us>
2008-05-06 19:56           ` Re: PQconnectdb question and md5 password Guy Deleeuw <G.De_Leeuw@eurofer.be>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox