aboutsummaryrefslogtreecommitdiff
path: root/src/backend/libpq/auth.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-08-14 04:51:34 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-08-14 04:51:34 +0000
commit80d0c4ffd351436c9e9480935e540d1413033aff (patch)
treebd879ed351e844fdfd6dce0f958df39528ea3f67 /src/backend/libpq/auth.c
parentca5db6cab1107ab177203b7aef80532ac99fdea6 (diff)
downloadpostgresql-80d0c4ffd351436c9e9480935e540d1413033aff.tar.gz
postgresql-80d0c4ffd351436c9e9480935e540d1413033aff.zip
The following patch makes postmaster -D work. -D specifies a different PGDATA
directory. The code that looks for the pg_hba file doesn't use it, though, so the postmaster uses the wrong pg_hba file. Also, when the postmaster looks in one directory and the user thinks it is looking in another directory, the error messages don't give enough information to solve the problem. I extended the error message for this. Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
Diffstat (limited to 'src/backend/libpq/auth.c')
-rw-r--r--src/backend/libpq/auth.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 7b4437736f4..ae02dfb6328 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.1.1.1 1996/07/09 06:21:30 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.2 1996/08/14 04:51:02 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -403,11 +403,8 @@ hba_recvauth(struct sockaddr_in *addr, PacketBuf *pbuf, StartupInfo *sp)
char *conf_file;
/* put together the full pathname to the config file */
- conf_file = (char *) malloc((strlen(GetPGData())+strlen(CONF_FILE)+2)*sizeof(char));
- strcpy(conf_file, GetPGData());
- strcat(conf_file, "/");
- strcat(conf_file, CONF_FILE);
-
+ conf_file = (char *) malloc((strlen(DataDir)+strlen(CONF_FILE)+2)*sizeof(char));
+ sprintf(conf_file, "%s/%s", DataDir, CONF_FILE);
/* Open the config file. */
file = fopen(conf_file, "r");
@@ -463,7 +460,10 @@ hba_recvauth(struct sockaddr_in *addr, PacketBuf *pbuf, StartupInfo *sp)
}
else
{ (void) sprintf(PQerrormsg,
- "hba_recvauth: config file does not exist or permissions are not setup correctly!\n");
+ "hba_recvauth: Host-based authentication config file "
+ "does not exist or permissions are not setup correctly! "
+ "Unable to open file \"%s\".\n",
+ conf_file);
fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg);
free(conf_file);