Unix Technical Forum

[PATCH] pg_autovacuum commandline password hiding.

This is a discussion on [PATCH] pg_autovacuum commandline password hiding. within the Pgsql Patches forums, part of the PostgreSQL category; --> Hi I'm not sure if you've done this for a later version of pg_autovacuum. I'm using what came with ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:21 AM
Ian FREISLICH
 
Posts: n/a
Default [PATCH] pg_autovacuum commandline password hiding.

Hi

I'm not sure if you've done this for a later version of pg_autovacuum.
I'm using what came with postgres-7.4.6. For database security on
a shared server (~800 logins) it's best to set the superuser password
and not allow passwordless connections. The only thing is that
pg_autovacuum keeps the password supplied on the commandline so
anyone that does a 'ps' can get the database superuser password.

--- pg_autovacuum.c.orig Mon Apr 18 08:08:27 2005
+++ pg_autovacuum.c Mon Apr 18 07:57:59 2005
@@ -879,7 +879,8 @@
args->user = optarg;
break;
case 'P':
- args->password = optarg;
+ args->password = strdup(optarg);
+ for (c = 0; optarg[c]; optarg[c++] = 'x');
break;
case 'H':
args->host = optarg;

I hope that this is a worthwhile patch.

Ian


--
Ian Freislich

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:21 AM
Neil Conway
 
Posts: n/a
Default Re: [PATCH] pg_autovacuum commandline password hiding.

Ian FREISLICH wrote:
> I'm not sure if you've done this for a later version of pg_autovacuum.
> I'm using what came with postgres-7.4.6. For database security on
> a shared server (~800 logins) it's best to set the superuser password
> and not allow passwordless connections. The only thing is that
> pg_autovacuum keeps the password supplied on the commandline so
> anyone that does a 'ps' can get the database superuser password.


Is this portable? Considering the hoops that
backend/utils/misc/ps_status.c jumps through to do something similar for
the postmaster, I would guess not.

BTW, I would suggest using ~/.pgpass, as that should be secure on all
platforms.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:21 AM
Tom Lane
 
Posts: n/a
Default Re: [PATCH] pg_autovacuum commandline password hiding.

Ian FREISLICH <if@hetzner.co.za> writes:
> ... The only thing is that
> pg_autovacuum keeps the password supplied on the commandline so
> anyone that does a 'ps' can get the database superuser password.


Which is exactly why we don't (and won't) provide such a switch.
Use ~/.pgpass instead.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com