Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit239f74d

Browse files
committed
psql forgot to close connection before re-issuing password prompt.
([BUGS] psql can crash the backend on login, 2000-09-03)
1 parentb5d609a commit239f74d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎src/bin/psql/command.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.35 2000/07/1718:24:32 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.36 2000/09/1720:33:45 petere Exp $
77
*/
88
#include"postgres.h"
99
#include"command.h"
@@ -1237,6 +1237,7 @@ do_connect(const char *new_dbname, const char *new_user)
12371237
if (PQstatus(pset.db)==CONNECTION_BAD&&
12381238
strcmp(PQerrorMessage(pset.db),"fe_sendauth: no password supplied\n")==0)
12391239
{
1240+
PQfinish(pset.db);
12401241
need_pass= true;
12411242
free(prompted_password);
12421243
prompted_password=NULL;

‎src/bin/psql/startup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.36 2000/09/06 19:54:48 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.37 2000/09/17 20:33:45 petere Exp $
77
*/
88
#include"postgres.h"
99

@@ -168,6 +168,7 @@ main(int argc, char *argv[])
168168
if (PQstatus(pset.db)==CONNECTION_BAD&&
169169
strcmp(PQerrorMessage(pset.db),"fe_sendauth: no password supplied\n")==0)
170170
{
171+
PQfinish(pset.db);
171172
need_pass= true;
172173
free(password);
173174
password=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp