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.
|
Summary: Reorganize tables in PostgreSQL databases without any locks.
|
||||||
Name: %{sname}
|
Name: %{sname}
|
||||||
Version: 1.1.3
|
Version: 1.1.4
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
@ -49,6 +49,7 @@ install -m 644 lib/uninstall_pg_reorg.sql %{buildroot}%{_datadir}/pgsql/contrib/
|
|||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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
|
* 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
|
* 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)
|
pgut_connect(const char *info, YesNo prompt, int elevel)
|
||||||
{
|
{
|
||||||
char *passwd;
|
char *passwd;
|
||||||
|
StringInfoData add_pass;
|
||||||
CHECK_FOR_INTERRUPTS();
|
|
||||||
|
|
||||||
if (prompt == YES)
|
if (prompt == YES)
|
||||||
|
{
|
||||||
passwd = prompt_for_password();
|
passwd = prompt_for_password();
|
||||||
|
initStringInfo(&add_pass);
|
||||||
|
appendStringInfo(&add_pass, info);
|
||||||
|
appendStringInfo(&add_pass, " password=%s ", passwd);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
passwd = NULL;
|
passwd = NULL;
|
||||||
|
|
||||||
@ -414,15 +418,17 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
|||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|
||||||
conn = PQconnectdb(info);
|
if(!passwd)
|
||||||
|
conn = PQconnectdb(info);
|
||||||
|
else
|
||||||
|
conn = PQconnectdb(add_pass.data);
|
||||||
|
|
||||||
if (PQstatus(conn) == CONNECTION_OK)
|
if (PQstatus(conn) == CONNECTION_OK)
|
||||||
{
|
{
|
||||||
pgutConn *c;
|
pgutConn *c;
|
||||||
|
|
||||||
free(passwd);
|
|
||||||
|
|
||||||
c = pgut_new(pgutConn);
|
c = pgut_new(pgutConn);
|
||||||
c->conn = conn;
|
c->conn = conn;
|
||||||
c->cancel = NULL;
|
c->cancel = NULL;
|
||||||
@ -432,6 +438,10 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
|||||||
pgut_connections = c;
|
pgut_connections = c;
|
||||||
pgut_conn_unlock();
|
pgut_conn_unlock();
|
||||||
|
|
||||||
|
if(passwd)
|
||||||
|
termStringInfo(&add_pass);
|
||||||
|
|
||||||
|
free(passwd);
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,6 +450,9 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
|
|||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
free(passwd);
|
free(passwd);
|
||||||
passwd = prompt_for_password();
|
passwd = prompt_for_password();
|
||||||
|
initStringInfo(&add_pass);
|
||||||
|
appendStringInfo(&add_pass, info);
|
||||||
|
appendStringInfo(&add_pass, " password=%s ", passwd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user