diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-06 01:00:12 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-06 01:00:12 +0000 |
| commit | d97ae8230e0c5be122e71341fd65d3e3553ed010 (patch) | |
| tree | d4b903a3f144b52e20cc5c0235177d12805a8817 /src/interfaces/libpq/fe-secure.c | |
| parent | fdbeaaf90a07c6703ec482c3f1bb3fb04882a64f (diff) | |
| download | postgresql-d97ae8230e0c5be122e71341fd65d3e3553ed010.tar.gz | |
Make the various places that determine the user's "home directory"
consistent. On Unix we now always consult getpwuid(); $HOME isn't used
at all. On Windows the code currently consults $USERPROFILE, or $HOME
if that's not defined, but I expect this will change as soon as the win32
hackers come to a consensus. Nothing done yet about changing the file
names used underneath $USERPROFILE.
Diffstat (limited to 'src/interfaces/libpq/fe-secure.c')
| -rw-r--r-- | src/interfaces/libpq/fe-secure.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c index 89064be506..a87d7221e2 100644 --- a/src/interfaces/libpq/fe-secure.c +++ b/src/interfaces/libpq/fe-secure.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.62 2005/01/04 23:18:25 tgl Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.63 2005/01/06 00:59:47 tgl Exp $ * * NOTES * [ Most of these notes are wrong/obsolete, but perhaps not all ] @@ -107,6 +107,7 @@ #endif #include <arpa/inet.h> #endif +#include <sys/stat.h> #ifdef ENABLE_THREAD_SAFETY #include <pthread.h> @@ -116,11 +117,6 @@ #include "strdup.h" #endif -#ifndef WIN32 -#include <pwd.h> -#endif -#include <sys/stat.h> - #ifdef USE_SSL #include <openssl/ssl.h> #include <openssl/dh.h> @@ -494,31 +490,6 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len) #ifdef USE_SSL /* - * Obtain user's home directory, return in given buffer - * - * This code isn't really SSL-specific, but currently we only need it in - * SSL-related places. - */ -static bool -pqGetHomeDirectory(char *buf, int bufsize) -{ -#ifndef WIN32 - char pwdbuf[BUFSIZ]; - struct passwd pwdstr; - struct passwd *pwd = NULL; - - if (pqGetpwuid(geteuid(), &pwdstr, pwdbuf, sizeof(pwdbuf), &pwd) != 0) - return false; - StrNCpy(buf, pwd->pw_dir, bufsize); - return true; - -#else - - return false; /* PLACEHOLDER */ -#endif -} - -/* * Certificate verification callback * * This callback allows us to log intermediate problems during |
