diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-02 18:39:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-02 18:39:57 +0000 |
commit | 8a069abd180250a5863160ed3b510a9d4c21c207 (patch) | |
tree | 359d39dceba0beeca39b8efe2e0c1dc236fdbdd8 /src/include/libpq/crypt.h | |
parent | 6babf6eab7a09127f0425c168a9e1ddffe5b4808 (diff) |
Fix pg_pwd caching mechanism, which was broken by changes to fork
postmaster children before client auth step. Postmaster now rereads
pg_pwd on receipt of SIGHUP, the same way that pg_hba.conf is handled.
No cycles need be expended to validate password cache validity during
connection startup.
Diffstat (limited to 'src/include/libpq/crypt.h')
-rw-r--r-- | src/include/libpq/crypt.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/include/libpq/crypt.h b/src/include/libpq/crypt.h index 39d677e166b..76dabc89bd4 100644 --- a/src/include/libpq/crypt.h +++ b/src/include/libpq/crypt.h @@ -1,9 +1,13 @@ /*------------------------------------------------------------------------- * * crypt.h - * Interface to hba.c + * Interface to libpq/crypt.c * + * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California * + * $Id: crypt.h,v 1.17 2001/11/02 18:39:57 tgl Exp $ + * *------------------------------------------------------------------------- */ #ifndef PG_CRYPT_H @@ -11,27 +15,22 @@ #include "libpq/libpq-be.h" -#define CRYPT_PWD_FILE "pg_pwd" -#define CRYPT_PWD_FILE_SEPCHAR "'\\t'" #define CRYPT_PWD_FILE_SEPSTR "\t" -#define CRYPT_PWD_RELOAD_SUFX ".reload" -extern char **pwd_cache; -extern int pwd_cache_count; +#define MD5_PASSWD_LEN 35 + +#define isMD5(passwd) (strncmp((passwd),"md5",3) == 0 && \ + strlen(passwd) == MD5_PASSWD_LEN) -extern char *crypt_getpwdfilename(void); -extern char *crypt_getpwdreloadfilename(void); -extern int md5_crypt_verify(const Port *port, const char *user, const char *pgpass); +extern char *crypt_getpwdfilename(void); +extern void load_password_cache(void); +extern int md5_crypt_verify(const Port *port, const char *user, + const char *pgpass); extern bool md5_hash(const void *buff, size_t len, char *hexsum); extern bool CheckMD5Pwd(char *passwd, char *storedpwd, char *seed); extern bool EncryptMD5(const char *passwd, const char *salt, size_t salt_len, char *buf); -#define MD5_PASSWD_LEN 35 - -#define isMD5(passwd) (strncmp((passwd),"md5",3) == 0 && \ - strlen(passwd) == MD5_PASSWD_LEN) - #endif |