diff options
Diffstat (limited to 'src/backend/libpq/hba.c')
-rw-r--r-- | src/backend/libpq/hba.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index daa4716e30b..c5be35f82bf 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -5,7 +5,7 @@ * wherein you authenticate a user by seeing what IP address the system * says he comes from and possibly using ident). * - * $Id: hba.c,v 1.37 1998/12/14 06:50:25 scrappy Exp $ + * $Id: hba.c,v 1.38 1999/01/17 06:18:25 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -390,7 +390,11 @@ find_hba_entry(SockAddr *raddr, const char *user, const char *database, old_conf_file = (char *) palloc(bufsize); snprintf(old_conf_file, bufsize, "%s/%s", DataDir, OLD_CONF_FILE); +#ifndef __CYGWIN32__ if ((fd = open(old_conf_file, O_RDONLY, 0)) != -1) +#else + if ((fd = open(old_conf_file, O_RDONLY | O_BINARY, 0)) != -1) +#endif { /* Old config file exists. Tell this guy he needs to upgrade. */ close(fd); @@ -801,7 +805,11 @@ verify_against_usermap(const char *pguser, map_file = (char *) palloc(bufsize); snprintf(map_file, bufsize, "%s/%s", DataDir, MAP_FILE); +#ifndef __CYGWIN32__ file = AllocateFile(map_file, "r"); +#else + file = AllocateFile(map_file, "rb"); +#endif if (file == NULL) { /* The open of the map file failed. */ @@ -973,7 +981,11 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir) bufsize = (strlen(DataDir) + strlen(CHARSET_FILE) + 2) * sizeof(char); map_file = (char *) palloc(bufsize); snprintf(map_file, bufsize, "%s/%s", DataDir, CHARSET_FILE); +#ifndef __CYGWIN32__ file = fopen(map_file, "r"); +#else + file = fopen(map_file, "rb"); +#endif if (file == NULL) { return; |