Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
b534a560
Commit
b534a560
authored
Sep 27, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove use of large BUFSIZ for buffers and use the proper struct sizes.
This greatly helps threaded libpq programs.
parent
e1c8b37a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
12 deletions
+10
-12
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-auth.c
+2
-2
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/fe-secure.c
+5
-5
src/port/getaddrinfo.c
src/port/getaddrinfo.c
+2
-2
src/port/thread.c
src/port/thread.c
+1
-3
No files found.
src/interfaces/libpq/fe-auth.c
View file @
b534a560
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.9
1 2004/08/29 04:13:12
momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.9
2 2004/09/27 23:38:45
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -749,7 +749,7 @@ fe_getauthname(char *PQerrormsg)
...
@@ -749,7 +749,7 @@ fe_getauthname(char *PQerrormsg)
if
(
GetUserName
(
username
,
&
namesize
))
if
(
GetUserName
(
username
,
&
namesize
))
name
=
username
;
name
=
username
;
#else
#else
char
pwdbuf
[
BUFSIZ
];
char
pwdbuf
[
sizeof
(
struct
passwd
)
];
struct
passwd
pwdstr
;
struct
passwd
pwdstr
;
struct
passwd
*
pw
=
NULL
;
struct
passwd
*
pw
=
NULL
;
...
...
src/interfaces/libpq/fe-secure.c
View file @
b534a560
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.5
2 2004/09/26 22:51:49 tgl
Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.5
3 2004/09/27 23:38:45 momjian
Exp $
*
*
* NOTES
* NOTES
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
...
@@ -512,7 +512,7 @@ verify_peer(PGconn *conn)
...
@@ -512,7 +512,7 @@ verify_peer(PGconn *conn)
{
{
struct
hostent
hpstr
;
struct
hostent
hpstr
;
char
buf
[
BUFSIZ
];
char
buf
[
sizeof
(
struct
hostent
)
];
int
herrno
=
0
;
int
herrno
=
0
;
/*
/*
...
@@ -598,7 +598,7 @@ load_dh_file(int keylength)
...
@@ -598,7 +598,7 @@ load_dh_file(int keylength)
#ifdef WIN32
#ifdef WIN32
return
NULL
;
return
NULL
;
#else
#else
char
pwdbuf
[
BUFSIZ
];
char
pwdbuf
[
sizeof
(
struct
passwd
)
];
struct
passwd
pwdstr
;
struct
passwd
pwdstr
;
struct
passwd
*
pwd
=
NULL
;
struct
passwd
*
pwd
=
NULL
;
FILE
*
fp
;
FILE
*
fp
;
...
@@ -745,7 +745,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
...
@@ -745,7 +745,7 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
#ifdef WIN32
#ifdef WIN32
return
0
;
return
0
;
#else
#else
char
pwdbuf
[
BUFSIZ
];
char
pwdbuf
[
sizeof
(
struct
passwd
)
];
struct
passwd
pwdstr
;
struct
passwd
pwdstr
;
struct
passwd
*
pwd
=
NULL
;
struct
passwd
*
pwd
=
NULL
;
struct
stat
buf
,
struct
stat
buf
,
...
@@ -952,7 +952,7 @@ initialize_SSL(PGconn *conn)
...
@@ -952,7 +952,7 @@ initialize_SSL(PGconn *conn)
{
{
#ifndef WIN32
#ifndef WIN32
struct
stat
buf
;
struct
stat
buf
;
char
pwdbuf
[
BUFSIZ
];
char
pwdbuf
[
sizeof
(
struct
passwd
)
];
struct
passwd
pwdstr
;
struct
passwd
pwdstr
;
struct
passwd
*
pwd
=
NULL
;
struct
passwd
*
pwd
=
NULL
;
char
fnbuf
[
MAXPGPATH
];
char
fnbuf
[
MAXPGPATH
];
...
...
src/port/getaddrinfo.c
View file @
b534a560
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
* Copyright (c) 2003, PostgreSQL Global Development Group
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.1
3 2004/09/27 23:24:45
momjian Exp $
* $PostgreSQL: pgsql/src/port/getaddrinfo.c,v 1.1
4 2004/09/27 23:39:14
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -85,7 +85,7 @@ getaddrinfo(const char *node, const char *service,
...
@@ -85,7 +85,7 @@ getaddrinfo(const char *node, const char *service,
#ifdef FRONTEND
#ifdef FRONTEND
struct
hostent
hpstr
;
struct
hostent
hpstr
;
char
buf
[
BUFSIZ
];
char
buf
[
sizeof
(
struct
hostent
)
];
int
herrno
=
0
;
int
herrno
=
0
;
pqGethostbyname
(
node
,
&
hpstr
,
buf
,
sizeof
(
buf
),
pqGethostbyname
(
node
,
&
hpstr
,
buf
,
sizeof
(
buf
),
...
...
src/port/thread.c
View file @
b534a560
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/port/thread.c,v 1.2
6 2004/09/27 23:24:45
momjian Exp $
* $PostgreSQL: pgsql/src/port/thread.c,v 1.2
7 2004/09/27 23:39:14
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -103,7 +103,6 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
...
@@ -103,7 +103,6 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
/* POSIX version */
/* POSIX version */
getpwuid_r
(
uid
,
resultbuf
,
buffer
,
buflen
,
result
);
getpwuid_r
(
uid
,
resultbuf
,
buffer
,
buflen
,
result
);
#else
#else
/*
/*
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
* getpwuid_r(uid, resultbuf, buffer, buflen)
* getpwuid_r(uid, resultbuf, buffer, buflen)
...
@@ -111,7 +110,6 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
...
@@ -111,7 +110,6 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
*
result
=
getpwuid_r
(
uid
,
resultbuf
,
buffer
,
buflen
);
*
result
=
getpwuid_r
(
uid
,
resultbuf
,
buffer
,
buflen
);
#endif
#endif
#else
#else
/* no getpwuid_r() available, just use getpwuid() */
/* no getpwuid_r() available, just use getpwuid() */
*
result
=
getpwuid
(
uid
);
*
result
=
getpwuid
(
uid
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment