1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Remove use of large BUFSIZ for buffers and use the proper struct sizes.

This greatly helps threaded libpq programs.
This commit is contained in:
Bruce Momjian
2004-09-27 23:39:14 +00:00
parent e1c8b37afb
commit b534a5605f
4 changed files with 10 additions and 12 deletions

View File

@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.91 2004/08/29 04:13:12 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.92 2004/09/27 23:38:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -749,7 +749,7 @@ fe_getauthname(char *PQerrormsg)
if (GetUserName(username, &namesize))
name = username;
#else
char pwdbuf[BUFSIZ];
char pwdbuf[sizeof(struct passwd)];
struct passwd pwdstr;
struct passwd *pw = NULL;

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.52 2004/09/26 22:51:49 tgl Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.53 2004/09/27 23:38:45 momjian Exp $
*
* NOTES
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -512,7 +512,7 @@ verify_peer(PGconn *conn)
{
struct hostent hpstr;
char buf[BUFSIZ];
char buf[sizeof(struct hostent)];
int herrno = 0;
/*
@@ -598,7 +598,7 @@ load_dh_file(int keylength)
#ifdef WIN32
return NULL;
#else
char pwdbuf[BUFSIZ];
char pwdbuf[sizeof(struct passwd)];
struct passwd pwdstr;
struct passwd *pwd = NULL;
FILE *fp;
@@ -745,7 +745,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
#ifdef WIN32
return 0;
#else
char pwdbuf[BUFSIZ];
char pwdbuf[sizeof(struct passwd)];
struct passwd pwdstr;
struct passwd *pwd = NULL;
struct stat buf,
@@ -952,7 +952,7 @@ initialize_SSL(PGconn *conn)
{
#ifndef WIN32
struct stat buf;
char pwdbuf[BUFSIZ];
char pwdbuf[sizeof(struct passwd)];
struct passwd pwdstr;
struct passwd *pwd = NULL;
char fnbuf[MAXPGPATH];