Using Ruby popen and PostgreSQL createuser?

Createuser is opening dev/tty to read the password Programs that read passwords usually sacrifice the Unix tools paradigm with respect to passwords. This is a reasonable thing to do because it allows other functionality to respect standard input and output, and put it all on pause while it opens dev/tty for an interactive password In any case, an strace(1) reveals that createuser is in fact opening dev/tty All is not lost createuser is just a link to usr/share/postgresql-common/pg_wrapper which is a Perl program. I'm sure it can be hacked for password scripting compatibility.

Createuser is opening /dev/tty to read the password Programs that read passwords usually sacrifice the Unix tools paradigm with respect to passwords. This is a reasonable thing to do because it allows other functionality to respect standard input and output, and put it all on pause while it opens /dev/tty for an interactive password. In any case, an strace(1) reveals that createuser is in fact opening /dev/tty.

All is not lost, createuser is just a link to /usr/share/postgresql-common/pg_wrapper which is a Perl program. I'm sure it can be hacked for password scripting compatibility.

Thanks for the info. Good to know that it simply doesn't work :-) – Topher Fangio Nov 12 '09 at 20:35 Thanks, I always wondered (although obviously not enough to actually find out) how that stuff work: why piping sql to psql doesn't break the standard password prompt, but asks me to type it in instead... ;) – Mladen Jablanović Nov 12 '09 at 21:44.

postgresql.org/docs/8.0/interactive/sql-... It seems safer and more reliable.

I had considered that previously, but I was hoping to find another method since using this method, the password will be echoed to the screen. I might be able to block it, but I doubt it. Then again, this will all be run under the root account.

– Topher Fangio Nov 12 '09 at 20:37.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions