Fixed problem with interactive authentication handling.
Previous pgut.c didn't handle any user-input during interactive authentication.
This commit is contained in:
parent
8ab15f2e72
commit
7865250a19
@ -4,7 +4,7 @@
|
||||
|
||||
Summary: Reorganize tables in PostgreSQL databases without any locks.
|
||||
Name: %{sname}
|
||||
Version: 1.1.3
|
||||
Version: 1.1.4
|
||||
Release: 1%{?dist}
|
||||
License: BSD
|
||||
Group: Applications/Databases
|
||||
@ -49,6 +49,7 @@ install -m 644 lib/uninstall_pg_reorg.sql %{buildroot}%{_datadir}/pgsql/contrib/
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Wed Sep 22 2010 - NTT OSS Center <sakamoto.masahiko@oss.ntt.co.jp> 1.1.4-1
|
||||
* Thu Apr 22 2010 - NTT OSS Center <itagaki.takahiro@oss.ntt.co.jp> 1.1.2-1
|
||||
* Mon Jan 15 2010 - Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp> 1.0.8-1
|
||||
* Tue Sep 08 2009 - Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp> 1.0.6-1
|
||||
|
@ -402,11 +402,15 @@ PGconn *
|
||||
pgut_connect(const char *info, YesNo prompt, int elevel)
|
||||
{
|
||||
char *passwd;
|
||||
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
StringInfoData add_pass;
|
||||
|
||||
if (prompt == YES)
|
||||
{
|
||||
passwd = prompt_for_password();
|
||||
initStringInfo(&add_pass);
|
||||
appendStringInfo(&add_pass, info);
|
||||
appendStringInfo(&add_pass, " password=%s ", passwd);
|
||||
}
|
||||
else
|
||||
passwd = NULL;
|
||||
|
||||
@ -414,15 +418,17 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
||||
for (;;)
|
||||
{
|
||||
PGconn *conn;
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
||||
conn = PQconnectdb(info);
|
||||
if(!passwd)
|
||||
conn = PQconnectdb(info);
|
||||
else
|
||||
conn = PQconnectdb(add_pass.data);
|
||||
|
||||
if (PQstatus(conn) == CONNECTION_OK)
|
||||
{
|
||||
pgutConn *c;
|
||||
|
||||
free(passwd);
|
||||
|
||||
c = pgut_new(pgutConn);
|
||||
c->conn = conn;
|
||||
c->cancel = NULL;
|
||||
@ -432,6 +438,10 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
||||
pgut_connections = c;
|
||||
pgut_conn_unlock();
|
||||
|
||||
if(passwd)
|
||||
termStringInfo(&add_pass);
|
||||
|
||||
free(passwd);
|
||||
return conn;
|
||||
}
|
||||
|
||||
@ -440,6 +450,9 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
||||
PQfinish(conn);
|
||||
free(passwd);
|
||||
passwd = prompt_for_password();
|
||||
initStringInfo(&add_pass);
|
||||
appendStringInfo(&add_pass, info);
|
||||
appendStringInfo(&add_pass, " password=%s ", passwd);
|
||||
continue;
|
||||
}
|
||||
ereport(elevel,
|
||||
|
Loading…
x
Reference in New Issue
Block a user