mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	ECPG connect routine only checked for NULL to find empty parameters, but user and password can also be "".
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.54 2009/06/11 14:49:13 momjian Exp $ */
 | 
			
		||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.55 2010/05/07 19:35:03 meskes Exp $ */
 | 
			
		||||
 | 
			
		||||
#define POSTGRES_ECPG_INTERNAL
 | 
			
		||||
#include "postgres_fe.h"
 | 
			
		||||
@@ -475,7 +475,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
 | 
			
		||||
			 host ? host : "<DEFAULT>",
 | 
			
		||||
			 port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port) : "<DEFAULT>",
 | 
			
		||||
			 options ? "with options " : "", options ? options : "",
 | 
			
		||||
			 user ? "for user " : "", user ? user : "");
 | 
			
		||||
			 (user && strlen(user) > 0) ? "for user " : "", user ? user : "");
 | 
			
		||||
 | 
			
		||||
	connect_string = ecpg_alloc(strlen_or_null(host)
 | 
			
		||||
								+ strlen_or_null(port)
 | 
			
		||||
@@ -494,8 +494,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
 | 
			
		||||
			realname ? "dbname=" : "", realname ? realname : "",
 | 
			
		||||
			host ? "host=" : "", host ? host : "",
 | 
			
		||||
			port ? "port=" : "", port ? port : "",
 | 
			
		||||
			user ? "user=" : "", user ? user : "",
 | 
			
		||||
			passwd ? "password=" : "", passwd ? passwd : "",
 | 
			
		||||
			(user && strlen(user) > 0) ? "user=" : "", user ? user : "",
 | 
			
		||||
			(passwd && strlen(passwd) > 0) ? "password=" : "", passwd ? passwd : "",
 | 
			
		||||
			options ? options : "");
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user