exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'.
Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines
altogether.
<!--
-$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.193 2005/10/13 17:55:18 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.194 2005/10/17 16:24:18 tgl Exp $
-->
<chapter id="libpq">
<para>
The deprecated functions
-<function>PQrequestCancel</function>,
-<function>PQoidStatus</function> and
-<function>fe_setauthsvc</function>
+<function>PQrequestCancel</function> and
+<function>PQoidStatus</function>
are not thread-safe and should not be used in multithread programs.
<function>PQrequestCancel</function> can be replaced by
<function>PQcancel</function>.
<function>PQoidStatus</function> can be replaced by
<function>PQoidValue</function>.
-There is no good reason to call <function>fe_setauthsvc</function> at all.
</para>
<para>
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.161 2005/10/15 02:49:16 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.162 2005/10/17 16:24:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
DirectFunctionCall1(textin, CStringGetDatum(password));
else
{
- if (!EncryptMD5(password, stmt->role, strlen(stmt->role),
- encrypted_password))
+ if (!pg_md5_encrypt(password, stmt->role, strlen(stmt->role),
+ encrypted_password))
elog(ERROR, "password encryption failed");
new_record[Anum_pg_authid_rolpassword - 1] =
DirectFunctionCall1(textin, CStringGetDatum(encrypted_password));
DirectFunctionCall1(textin, CStringGetDatum(password));
else
{
- if (!EncryptMD5(password, stmt->role, strlen(stmt->role),
- encrypted_password))
+ if (!pg_md5_encrypt(password, stmt->role, strlen(stmt->role),
+ encrypted_password))
elog(ERROR, "password encryption failed");
new_record[Anum_pg_authid_rolpassword - 1] =
DirectFunctionCall1(textin, CStringGetDatum(encrypted_password));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.131 2005/10/15 21:27:19 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.132 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
char hostinfo[NI_MAXHOST];
- getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- hostinfo, sizeof(hostinfo),
- NULL, 0,
- NI_NUMERICHOST);
+ pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
+ hostinfo, sizeof(hostinfo),
+ NULL, 0,
+ NI_NUMERICHOST);
#ifdef USE_SSL
ereport(FATAL,
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.66 2005/10/15 02:49:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.67 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (isMD5(shadow_pass))
{
/* stored password already encrypted, only do salt */
- if (!EncryptMD5(shadow_pass + strlen("md5"),
- (char *) port->md5Salt,
- sizeof(port->md5Salt), crypt_pwd))
+ if (!pg_md5_encrypt(shadow_pass + strlen("md5"),
+ (char *) port->md5Salt,
+ sizeof(port->md5Salt), crypt_pwd))
{
pfree(crypt_pwd);
return STATUS_ERROR;
/* stored password is plain, double-encrypt */
char *crypt_pwd2 = palloc(MD5_PASSWD_LEN + 1);
- if (!EncryptMD5(shadow_pass,
- port->user_name,
- strlen(port->user_name),
- crypt_pwd2))
+ if (!pg_md5_encrypt(shadow_pass,
+ port->user_name,
+ strlen(port->user_name),
+ crypt_pwd2))
{
pfree(crypt_pwd);
pfree(crypt_pwd2);
return STATUS_ERROR;
}
- if (!EncryptMD5(crypt_pwd2 + strlen("md5"),
- port->md5Salt,
- sizeof(port->md5Salt),
- crypt_pwd))
+ if (!pg_md5_encrypt(crypt_pwd2 + strlen("md5"),
+ port->md5Salt,
+ sizeof(port->md5Salt),
+ crypt_pwd))
{
pfree(crypt_pwd);
pfree(crypt_pwd2);
{
/* Encrypt user-supplied password to match stored MD5 */
crypt_client_pass = palloc(MD5_PASSWD_LEN + 1);
- if (!EncryptMD5(client_pass,
- port->user_name,
- strlen(port->user_name),
- crypt_client_pass))
+ if (!pg_md5_encrypt(client_pass,
+ port->user_name,
+ strlen(port->user_name),
+ crypt_client_pass))
{
pfree(crypt_client_pass);
return STATUS_ERROR;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.148 2005/10/15 02:49:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.149 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
hints.ai_addr = NULL;
hints.ai_next = NULL;
- ret = getaddrinfo_all(token, NULL, &hints, &gai_result);
+ ret = pg_getaddrinfo_all(token, NULL, &hints, &gai_result);
if (ret || !gai_result)
{
ereport(LOG,
if (cidr_slash)
*cidr_slash = '/';
if (gai_result)
- freeaddrinfo_all(hints.ai_family, gai_result);
+ pg_freeaddrinfo_all(hints.ai_family, gai_result);
goto hba_other_error;
}
*cidr_slash = '/';
memcpy(&addr, gai_result->ai_addr, gai_result->ai_addrlen);
- freeaddrinfo_all(hints.ai_family, gai_result);
+ pg_freeaddrinfo_all(hints.ai_family, gai_result);
/* Get the netmask */
if (cidr_slash)
{
- if (SockAddr_cidr_mask(&mask, cidr_slash + 1, addr.ss_family) < 0)
+ if (pg_sockaddr_cidr_mask(&mask, cidr_slash + 1,
+ addr.ss_family) < 0)
goto hba_syntax;
}
else
goto hba_syntax;
token = lfirst(line_item);
- ret = getaddrinfo_all(token, NULL, &hints, &gai_result);
+ ret = pg_getaddrinfo_all(token, NULL, &hints, &gai_result);
if (ret || !gai_result)
{
ereport(LOG,
token, HbaFileName, line_num,
gai_strerror(ret))));
if (gai_result)
- freeaddrinfo_all(hints.ai_family, gai_result);
+ pg_freeaddrinfo_all(hints.ai_family, gai_result);
goto hba_other_error;
}
memcpy(&mask, gai_result->ai_addr, gai_result->ai_addrlen);
- freeaddrinfo_all(hints.ai_family, gai_result);
+ pg_freeaddrinfo_all(hints.ai_family, gai_result);
if (addr.ss_family != mask.ss_family)
{
if (addr.ss_family == AF_INET &&
port->raddr.addr.ss_family == AF_INET6)
{
- promote_v4_to_v6_addr(&addr);
- promote_v4_to_v6_mask(&mask);
+ pg_promote_v4_to_v6_addr(&addr);
+ pg_promote_v4_to_v6_mask(&mask);
}
else
#endif /* HAVE_IPV6 */
}
/* Ignore line if client port is not in the matching addr range. */
- if (!rangeSockAddr(&port->raddr.addr, &addr, &mask))
+ if (!pg_range_sockaddr(&port->raddr.addr, &addr, &mask))
return;
/* Read the rest of the line. */
* Might look a little weird to first convert it to text and then back to
* sockaddr, but it's protocol independent.
*/
- getnameinfo_all(&remote_addr.addr, remote_addr.salen,
- remote_addr_s, sizeof(remote_addr_s),
- remote_port, sizeof(remote_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
- getnameinfo_all(&local_addr.addr, local_addr.salen,
- local_addr_s, sizeof(local_addr_s),
- local_port, sizeof(local_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
+ pg_getnameinfo_all(&remote_addr.addr, remote_addr.salen,
+ remote_addr_s, sizeof(remote_addr_s),
+ remote_port, sizeof(remote_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
+ pg_getnameinfo_all(&local_addr.addr, local_addr.salen,
+ local_addr_s, sizeof(local_addr_s),
+ local_port, sizeof(local_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
snprintf(ident_port, sizeof(ident_port), "%d", IDENT_PORT);
hints.ai_flags = AI_NUMERICHOST;
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
- rc = getaddrinfo_all(remote_addr_s, ident_port, &hints, &ident_serv);
+ rc = pg_getaddrinfo_all(remote_addr_s, ident_port, &hints, &ident_serv);
if (rc || !ident_serv)
{
if (ident_serv)
- freeaddrinfo_all(hints.ai_family, ident_serv);
+ pg_freeaddrinfo_all(hints.ai_family, ident_serv);
return false; /* we don't expect this to happen */
}
hints.ai_canonname = NULL;
hints.ai_addr = NULL;
hints.ai_next = NULL;
- rc = getaddrinfo_all(local_addr_s, NULL, &hints, &la);
+ rc = pg_getaddrinfo_all(local_addr_s, NULL, &hints, &la);
if (rc || !la)
{
if (la)
- freeaddrinfo_all(hints.ai_family, la);
+ pg_freeaddrinfo_all(hints.ai_family, la);
return false; /* we don't expect this to happen */
}
ident_inet_done:
if (sock_fd >= 0)
closesocket(sock_fd);
- freeaddrinfo_all(remote_addr.addr.ss_family, ident_serv);
- freeaddrinfo_all(local_addr.addr.ss_family, la);
+ pg_freeaddrinfo_all(remote_addr.addr.ss_family, ident_serv);
+ pg_freeaddrinfo_all(local_addr.addr.ss_family, la);
return ident_return;
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.31 2004/12/31 21:59:50 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.32 2005/10/17 16:24:19 tgl Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
#include "libpq/ip.h"
-static int rangeSockAddrAF_INET(const struct sockaddr_in * addr,
- const struct sockaddr_in * netaddr,
- const struct sockaddr_in * netmask);
+static int range_sockaddr_AF_INET(const struct sockaddr_in *addr,
+ const struct sockaddr_in *netaddr,
+ const struct sockaddr_in *netmask);
#ifdef HAVE_IPV6
-static int rangeSockAddrAF_INET6(const struct sockaddr_in6 * addr,
- const struct sockaddr_in6 * netaddr,
- const struct sockaddr_in6 * netmask);
+static int range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
+ const struct sockaddr_in6 *netaddr,
+ const struct sockaddr_in6 *netmask);
#endif
#ifdef HAVE_UNIX_SOCKETS
static int getaddrinfo_unix(const char *path,
- const struct addrinfo * hintsp,
- struct addrinfo ** result);
+ const struct addrinfo *hintsp,
+ struct addrinfo **result);
-static int getnameinfo_unix(const struct sockaddr_un * sa, int salen,
+static int getnameinfo_unix(const struct sockaddr_un *sa, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags);
/*
- * getaddrinfo_all - get address info for Unix, IPv4 and IPv6 sockets
+ * pg_getaddrinfo_all - get address info for Unix, IPv4 and IPv6 sockets
*/
int
-getaddrinfo_all(const char *hostname, const char *servname,
- const struct addrinfo * hintp, struct addrinfo ** result)
+pg_getaddrinfo_all(const char *hostname, const char *servname,
+ const struct addrinfo *hintp, struct addrinfo **result)
{
/* not all versions of getaddrinfo() zero *result on failure */
*result = NULL;
/*
- * freeaddrinfo_all - free addrinfo structures for IPv4, IPv6, or Unix
+ * pg_freeaddrinfo_all - free addrinfo structures for IPv4, IPv6, or Unix
*
* Note: the ai_family field of the original hint structure must be passed
* so that we can tell whether the addrinfo struct was built by the system's
* not safe to look at ai_family in the addrinfo itself.
*/
void
-freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai)
+pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai)
{
#ifdef HAVE_UNIX_SOCKETS
if (hint_ai_family == AF_UNIX)
{
- /* struct was built by getaddrinfo_unix (see getaddrinfo_all) */
+ /* struct was built by getaddrinfo_unix (see pg_getaddrinfo_all) */
while (ai != NULL)
{
struct addrinfo *p = ai;
/*
- * getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets
+ * pg_getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets
*
* The API of this routine differs from the standard getnameinfo() definition
* in two ways: first, the addr parameter is declared as sockaddr_storage
* guaranteed to be filled with something even on failure return.
*/
int
-getnameinfo_all(const struct sockaddr_storage * addr, int salen,
- char *node, int nodelen,
- char *service, int servicelen,
- int flags)
+pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen,
+ char *node, int nodelen,
+ char *service, int servicelen,
+ int flags)
{
int rc;
* -------
*/
static int
-getaddrinfo_unix(const char *path, const struct addrinfo * hintsp,
- struct addrinfo ** result)
+getaddrinfo_unix(const char *path, const struct addrinfo *hintsp,
+ struct addrinfo **result)
{
struct addrinfo hints;
struct addrinfo *aip;
* Convert an address to a hostname.
*/
static int
-getnameinfo_unix(const struct sockaddr_un * sa, int salen,
+getnameinfo_unix(const struct sockaddr_un *sa, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags)
return 0;
}
+
#endif /* HAVE_UNIX_SOCKETS */
/*
- * rangeSockAddr - is addr within the subnet specified by netaddr/netmask ?
+ * pg_range_sockaddr - is addr within the subnet specified by netaddr/netmask ?
*
* Note: caller must already have verified that all three addresses are
* in the same address family; and AF_UNIX addresses are not supported.
*/
int
-rangeSockAddr(const struct sockaddr_storage * addr,
- const struct sockaddr_storage * netaddr,
- const struct sockaddr_storage * netmask)
+pg_range_sockaddr(const struct sockaddr_storage *addr,
+ const struct sockaddr_storage *netaddr,
+ const struct sockaddr_storage *netmask)
{
if (addr->ss_family == AF_INET)
- return rangeSockAddrAF_INET((struct sockaddr_in *) addr,
- (struct sockaddr_in *) netaddr,
- (struct sockaddr_in *) netmask);
+ return range_sockaddr_AF_INET((struct sockaddr_in *) addr,
+ (struct sockaddr_in *) netaddr,
+ (struct sockaddr_in *) netmask);
#ifdef HAVE_IPV6
else if (addr->ss_family == AF_INET6)
- return rangeSockAddrAF_INET6((struct sockaddr_in6 *) addr,
- (struct sockaddr_in6 *) netaddr,
- (struct sockaddr_in6 *) netmask);
+ return range_sockaddr_AF_INET6((struct sockaddr_in6 *) addr,
+ (struct sockaddr_in6 *) netaddr,
+ (struct sockaddr_in6 *) netmask);
#endif
else
return 0;
}
static int
-rangeSockAddrAF_INET(const struct sockaddr_in * addr,
- const struct sockaddr_in * netaddr,
- const struct sockaddr_in * netmask)
+range_sockaddr_AF_INET(const struct sockaddr_in *addr,
+ const struct sockaddr_in *netaddr,
+ const struct sockaddr_in *netmask)
{
if (((addr->sin_addr.s_addr ^ netaddr->sin_addr.s_addr) &
netmask->sin_addr.s_addr) == 0)
#ifdef HAVE_IPV6
+
static int
-rangeSockAddrAF_INET6(const struct sockaddr_in6 * addr,
- const struct sockaddr_in6 * netaddr,
- const struct sockaddr_in6 * netmask)
+range_sockaddr_AF_INET6(const struct sockaddr_in6 *addr,
+ const struct sockaddr_in6 *netaddr,
+ const struct sockaddr_in6 *netmask)
{
int i;
return 1;
}
-#endif
+
+#endif /* HAVE_IPV6 */
/*
- * SockAddr_cidr_mask - make a network mask of the appropriate family
+ * pg_sockaddr_cidr_mask - make a network mask of the appropriate family
* and required number of significant bits
*
* The resulting mask is placed in *mask, which had better be big enough.
* Return value is 0 if okay, -1 if not.
*/
int
-SockAddr_cidr_mask(struct sockaddr_storage * mask, char *numbits, int family)
+pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family)
{
long bits;
char *endptr;
#ifdef HAVE_IPV6
/*
- * promote_v4_to_v6_addr --- convert an AF_INET addr to AF_INET6, using
+ * pg_promote_v4_to_v6_addr --- convert an AF_INET addr to AF_INET6, using
* the standard convention for IPv4 addresses mapped into IPv6 world
*
* The passed addr is modified in place; be sure it is large enough to
* hold the result! Note that we only worry about setting the fields
- * that rangeSockAddr will look at.
+ * that pg_range_sockaddr will look at.
*/
void
-promote_v4_to_v6_addr(struct sockaddr_storage * addr)
+pg_promote_v4_to_v6_addr(struct sockaddr_storage *addr)
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;
}
/*
- * promote_v4_to_v6_mask --- convert an AF_INET netmask to AF_INET6, using
+ * pg_promote_v4_to_v6_mask --- convert an AF_INET netmask to AF_INET6, using
* the standard convention for IPv4 addresses mapped into IPv6 world
*
- * This must be different from promote_v4_to_v6_addr because we want to
+ * This must be different from pg_promote_v4_to_v6_addr because we want to
* set the high-order bits to 1's not 0's.
*
* The passed addr is modified in place; be sure it is large enough to
* hold the result! Note that we only worry about setting the fields
- * that rangeSockAddr will look at.
+ * that pg_range_sockaddr will look at.
*/
void
-promote_v4_to_v6_mask(struct sockaddr_storage * addr)
+pg_promote_v4_to_v6_mask(struct sockaddr_storage *addr)
{
struct sockaddr_in addr4;
struct sockaddr_in6 addr6;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/libpq/md5.c,v 1.29 2005/10/15 02:49:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/md5.c,v 1.30 2005/10/17 16:24:19 tgl Exp $
*/
*/
/*
- * md5_hash
+ * pg_md5_hash
*
* Calculates the MD5 sum of the bytes in a buffer.
*
* SYNOPSIS #include "crypt.h"
- * int md5_hash(const void *buff, size_t len, char *hexsum)
+ * int pg_md5_hash(const void *buff, size_t len, char *hexsum)
*
* INPUT buff the buffer containing the bytes that you want
* the MD5 sum of.
*
*/
bool
-md5_hash(const void *buff, size_t len, char *hexsum)
+pg_md5_hash(const void *buff, size_t len, char *hexsum)
{
uint8 sum[16];
* Returns TRUE if okay, FALSE on error (out of memory).
*/
bool
-EncryptMD5(const char *passwd, const char *salt, size_t salt_len,
- char *buf)
+pg_md5_encrypt(const char *passwd, const char *salt, size_t salt_len,
+ char *buf)
{
size_t passwd_len = strlen(passwd);
char *crypt_buf = palloc(passwd_len + salt_len);
memcpy(crypt_buf + passwd_len, salt, salt_len);
strcpy(buf, "md5");
- ret = md5_hash(crypt_buf, passwd_len + salt_len, buf + 3);
+ ret = pg_md5_hash(crypt_buf, passwd_len + salt_len, buf + 3);
pfree(crypt_buf);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.181 2005/10/15 02:49:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.182 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
service = portNumberStr;
}
- ret = getaddrinfo_all(hostName, service, &hint, &addrs);
+ ret = pg_getaddrinfo_all(hostName, service, &hint, &addrs);
if (ret || !addrs)
{
if (hostName)
(errmsg("could not translate service \"%s\" to address: %s",
service, gai_strerror(ret))));
if (addrs)
- freeaddrinfo_all(hint.ai_family, addrs);
+ pg_freeaddrinfo_all(hint.ai_family, addrs);
return STATUS_ERROR;
}
added++;
}
- freeaddrinfo_all(hint.ai_family, addrs);
+ pg_freeaddrinfo_all(hint.ai_family, addrs);
if (!added)
return STATUS_ERROR;
*
* Copyright (c) 2001-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.110 2005/10/15 02:49:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.111 2005/10/17 16:24:19 tgl Exp $
* ----------
*/
#include "postgres.h"
hints.ai_addr = NULL;
hints.ai_canonname = NULL;
hints.ai_next = NULL;
- ret = getaddrinfo_all("localhost", NULL, &hints, &addrs);
+ ret = pg_getaddrinfo_all("localhost", NULL, &hints, &addrs);
if (ret || !addrs)
{
ereport(LOG,
}
/*
- * On some platforms, getaddrinfo_all() may return multiple addresses only
- * one of which will actually work (eg, both IPv6 and IPv4 addresses when
- * kernel will reject IPv6). Worse, the failure may occur at the bind()
- * or perhaps even connect() stage. So we must loop through the results
- * till we find a working combination. We will generate LOG messages, but
- * no error, for bogus combinations.
+ * On some platforms, pg_getaddrinfo_all() may return multiple addresses
+ * only one of which will actually work (eg, both IPv6 and IPv4 addresses
+ * when kernel will reject IPv6). Worse, the failure may occur at the
+ * bind() or perhaps even connect() stage. So we must loop through the
+ * results till we find a working combination. We will generate LOG
+ * messages, but no error, for bogus combinations.
*/
for (addr = addrs; addr; addr = addr->ai_next)
{
goto startup_failed;
}
- freeaddrinfo_all(hints.ai_family, addrs);
+ pg_freeaddrinfo_all(hints.ai_family, addrs);
return;
(errmsg("disabling statistics collector for lack of working socket")));
if (addrs)
- freeaddrinfo_all(hints.ai_family, addrs);
+ pg_freeaddrinfo_all(hints.ai_family, addrs);
if (pgStatSock >= 0)
closesocket(pgStatSock);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.469 2005/10/15 02:49:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.470 2005/10/17 16:24:19 tgl Exp $
*
* NOTES
*
*/
remote_host[0] = '\0';
remote_port[0] = '\0';
- if (getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- remote_host, sizeof(remote_host),
- remote_port, sizeof(remote_port),
- (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV))
+ if (pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
+ remote_host, sizeof(remote_host),
+ remote_port, sizeof(remote_port),
+ (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV))
{
- int ret = getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- remote_host, sizeof(remote_host),
- remote_port, sizeof(remote_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
+ int ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
+ remote_host, sizeof(remote_host),
+ remote_port, sizeof(remote_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
ereport(WARNING,
- (errmsg("getnameinfo_all() failed: %s",
- gai_strerror(ret))));
+ (errmsg_internal("pg_getnameinfo_all() failed: %s",
+ gai_strerror(ret))));
}
snprintf(remote_ps_data, sizeof(remote_ps_data),
remote_port[0] == '\0' ? "%s" : "%s(%s)",
/*
* PostgreSQL type definitions for the INET and CIDR types.
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.55 2005/10/15 02:49:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.56 2005/10/17 16:24:19 tgl Exp $
*
* Jon Postel RIP 16 Oct 1998
*/
remote_host[0] = '\0';
- ret = getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- remote_host, sizeof(remote_host),
- NULL, 0,
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
+ remote_host, sizeof(remote_host),
+ NULL, 0,
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
remote_port[0] = '\0';
- ret = getnameinfo_all(&port->raddr.addr, port->raddr.salen,
- NULL, 0,
- remote_port, sizeof(remote_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
+ NULL, 0,
+ remote_port, sizeof(remote_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
local_host[0] = '\0';
- ret = getnameinfo_all(&port->laddr.addr, port->laddr.salen,
- local_host, sizeof(local_host),
- NULL, 0,
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&port->laddr.addr, port->laddr.salen,
+ local_host, sizeof(local_host),
+ NULL, 0,
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
local_port[0] = '\0';
- ret = getnameinfo_all(&port->laddr.addr, port->laddr.salen,
- NULL, 0,
- local_port, sizeof(local_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&port->laddr.addr, port->laddr.salen,
+ NULL, 0,
+ local_port, sizeof(local_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.25 2005/10/15 02:49:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/pgstatfuncs.c,v 1.26 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
remote_host[0] = '\0';
- ret = getnameinfo_all(&beentry->clientaddr.addr, beentry->clientaddr.salen,
- remote_host, sizeof(remote_host),
- NULL, 0,
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&beentry->clientaddr.addr, beentry->clientaddr.salen,
+ remote_host, sizeof(remote_host),
+ NULL, 0,
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
}
remote_port[0] = '\0';
- ret = getnameinfo_all(&beentry->clientaddr.addr,
- beentry->clientaddr.salen,
- NULL, 0,
- remote_port, sizeof(remote_port),
- NI_NUMERICHOST | NI_NUMERICSERV);
+ ret = pg_getnameinfo_all(&beentry->clientaddr.addr,
+ beentry->clientaddr.salen,
+ NULL, 0,
+ remote_port, sizeof(remote_port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
if (ret)
PG_RETURN_NULL();
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.136 2005/10/15 02:49:30 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.137 2005/10/17 16:24:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
len = VARSIZE(in_text) - VARHDRSZ;
/* get the hash result */
- if (md5_hash(VARDATA(in_text), len, hexsum) == false)
+ if (pg_md5_hash(VARDATA(in_text), len, hexsum) == false)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
text *result_text;
len = VARSIZE(in) - VARHDRSZ;
- if (md5_hash(VARDATA(in), len, hexsum) == false)
+ if (pg_md5_hash(VARDATA(in), len, hexsum) == false)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory")));
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/libpq/auth.h,v 1.30 2005/10/15 02:49:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/auth.h,v 1.31 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq/libpq-be.h"
-/*----------------------------------------------------------------
- * Common routines and definitions
- *----------------------------------------------------------------
- */
-
-extern void ClientAuthentication(Port *port);
-
-#define PG_KRB5_VERSION "PGVER5.1" /* at most KRB_SENDAUTH_VLEN chars */
-
extern char *pg_krb_server_keyfile;
extern char *pg_krb_srvnam;
extern bool pg_krb_caseins_users;
extern char *pg_krb_server_hostname;
+extern void ClientAuthentication(Port *port);
+
#endif /* AUTH_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.31 2005/05/25 21:40:42 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.32 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
strlen(passwd) == MD5_PASSWD_LEN)
+/* in crypt.c */
extern int md5_crypt_verify(const Port *port, const char *user,
char *client_pass);
-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,
+/* in md5.c --- these are also present in frontend libpq */
+extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum);
+extern bool pg_md5_encrypt(const char *passwd, const char *salt,
size_t salt_len, char *buf);
#endif
*
* Copyright (c) 2003-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/libpq/ip.h,v 1.14 2005/01/01 20:44:27 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/ip.h,v 1.15 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq/pqcomm.h"
-extern int getaddrinfo_all(const char *hostname, const char *servname,
- const struct addrinfo * hintp,
- struct addrinfo ** result);
-extern void freeaddrinfo_all(int hint_ai_family, struct addrinfo * ai);
+extern int pg_getaddrinfo_all(const char *hostname, const char *servname,
+ const struct addrinfo *hintp,
+ struct addrinfo **result);
+extern void pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai);
-extern int getnameinfo_all(const struct sockaddr_storage * addr, int salen,
+extern int pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen,
char *node, int nodelen,
char *service, int servicelen,
int flags);
-extern int rangeSockAddr(const struct sockaddr_storage * addr,
- const struct sockaddr_storage * netaddr,
- const struct sockaddr_storage * netmask);
+extern int pg_range_sockaddr(const struct sockaddr_storage *addr,
+ const struct sockaddr_storage *netaddr,
+ const struct sockaddr_storage *netmask);
-extern int SockAddr_cidr_mask(struct sockaddr_storage * mask,
+extern int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask,
char *numbits, int family);
#ifdef HAVE_IPV6
-extern void promote_v4_to_v6_addr(struct sockaddr_storage * addr);
-extern void promote_v4_to_v6_mask(struct sockaddr_storage * addr);
+extern void pg_promote_v4_to_v6_addr(struct sockaddr_storage *addr);
+extern void pg_promote_v4_to_v6_mask(struct sockaddr_storage *addr);
#endif
#ifdef HAVE_UNIX_SOCKETS
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.105 2005/10/15 02:49:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.106 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* INTERFACE ROUTINES
* frontend (client) routines:
- * fe_sendauth send authentication information
- * fe_getauthname get user's name according to the client side
+ * pg_fe_sendauth send authentication information
+ * pg_fe_getauthname get user's name according to the client side
* of the authentication system
- * fe_setauthsvc set frontend authentication service
- * fe_getauthsvc get current frontend authentication service
- *
- *
- *
*/
#include "postgres_fe.h"
#else
#include <unistd.h>
#include <fcntl.h>
-#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#include <sys/socket.h>
#include "libpq/crypt.h"
-/*
- * common definitions for generic fe/be routines
- */
-
-#define STARTUP_MSG 7 /* Initialise a connection */
-#define STARTUP_KRB4_MSG 10 /* krb4 session follows. Not supported any
- * more. */
-#define STARTUP_KRB5_MSG 11 /* krb5 session follows */
-#define STARTUP_PASSWORD_MSG 14 /* Password follows */
-
-struct authsvc
-{
- const char *name; /* service nickname (for command line) */
- MsgType msgtype; /* startup packet header type */
- int allowed; /* initially allowed (before command line
- * option parsing)? */
-};
-
-/*
- * Command-line parsing routines use this structure to map nicknames
- * onto service types (and the startup packets to use with them).
- *
- * Programs receiving an authentication request use this structure to
- * decide which authentication service types are currently permitted.
- * By default, all authentication systems compiled into the system are
- * allowed. Unauthenticated connections are disallowed unless there
- * isn't any authentication system.
- */
-static const struct authsvc authsvcs[] = {
-#ifdef KRB5
- {"krb5", STARTUP_KRB5_MSG, 1},
- {"kerberos", STARTUP_KRB5_MSG, 1},
-#endif /* KRB5 */
- {UNAUTHNAME, STARTUP_MSG,
-#ifdef KRB5
- 0
-#else /* !KRB5 */
- 1
-#endif /* !KRB5 */
- },
- {"password", STARTUP_PASSWORD_MSG, 0}
-};
-
-static const int n_authsvcs = sizeof(authsvcs) / sizeof(struct authsvc);
-
#ifdef KRB5
/*
* MIT Kerberos authentication system - protocol version 5
return ret;
}
+
#endif /* KRB5 */
+
/*
* Respond to AUTH_REQ_SCM_CREDS challenge.
*
}
crypt_pwd2 = crypt_pwd + MD5_PASSWD_LEN + 1;
- if (!EncryptMD5(password, conn->pguser,
- strlen(conn->pguser), crypt_pwd2))
+ if (!pg_md5_encrypt(password, conn->pguser,
+ strlen(conn->pguser), crypt_pwd2))
{
free(crypt_pwd);
return STATUS_ERROR;
}
- if (!EncryptMD5(crypt_pwd2 + strlen("md5"), conn->md5Salt,
- sizeof(conn->md5Salt), crypt_pwd))
+ if (!pg_md5_encrypt(crypt_pwd2 + strlen("md5"), conn->md5Salt,
+ sizeof(conn->md5Salt), crypt_pwd))
{
free(crypt_pwd);
return STATUS_ERROR;
}
/*
- * fe_sendauth -- client demux routine for outgoing authentication information
+ * pg_fe_sendauth
+ * client demux routine for outgoing authentication information
*/
int
-fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
- const char *password, char *PQerrormsg)
+pg_fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
+ const char *password, char *PQerrormsg)
{
#ifndef KRB5
(void) hostname; /* not used */
return STATUS_OK;
}
-/*
- * fe_setauthsvc
- * fe_getauthsvc
- *
- * Set/return the authentication service currently selected for use by the
- * frontend. (You can only use one in the frontend, obviously.)
- *
- * NB: This is not thread-safe if different threads try to select different
- * authentication services! It's OK for fe_getauthsvc to select the default,
- * since that will be the same for all threads, but direct application use
- * of fe_setauthsvc is not thread-safe. However, use of fe_setauthsvc is
- * deprecated anyway...
- */
-
-static int pg_authsvc = -1;
-
-void
-fe_setauthsvc(const char *name, char *PQerrormsg)
-{
- int i;
-
- for (i = 0; i < n_authsvcs; ++i)
- if (strcmp(name, authsvcs[i].name) == 0)
- {
- pg_authsvc = i;
- break;
- }
- if (i == n_authsvcs)
- {
- snprintf(PQerrormsg, PQERRORMSG_LENGTH,
- libpq_gettext("invalid authentication service name \"%s\", ignored\n"),
- name);
- }
- return;
-}
-
-MsgType
-fe_getauthsvc(char *PQerrormsg)
-{
- if (pg_authsvc < 0 || pg_authsvc >= n_authsvcs)
- {
- fe_setauthsvc(DEFAULT_CLIENT_AUTHSVC, PQerrormsg);
- if (pg_authsvc < 0 || pg_authsvc >= n_authsvcs)
- {
- /* Can only get here if DEFAULT_CLIENT_AUTHSVC is misdefined */
- return 0;
- }
- }
- return authsvcs[pg_authsvc].msgtype;
-}
/*
- * fe_getauthname -- returns a pointer to dynamic space containing whatever
+ * pg_fe_getauthname -- returns a pointer to dynamic space containing whatever
* name the user has authenticated to the system
- * if there is an error, return the error message in PQerrormsg
+ *
+ * if there is an error, return NULL with an error message in PQerrormsg
*/
char *
-fe_getauthname(char *PQerrormsg)
+pg_fe_getauthname(char *PQerrormsg)
{
const char *name = NULL;
char *authn;
- MsgType authsvc;
#ifdef WIN32
char username[128];
struct passwd *pw = NULL;
#endif
- authsvc = fe_getauthsvc(PQerrormsg);
-
- /* this just guards against broken DEFAULT_CLIENT_AUTHSVC, see above */
- if (authsvc == 0)
- return NULL; /* leave original error message in place */
-
pglock_thread();
#ifdef KRB5
- if (authsvc == STARTUP_KRB5_MSG)
- name = pg_krb5_authname(PQerrormsg);
+ name = pg_krb5_authname(PQerrormsg);
#endif
- if (authsvc == STARTUP_MSG
- || (authsvc == STARTUP_KRB5_MSG && !name))
+ if (!name)
{
#ifdef WIN32
if (GetUserName(username, &namesize))
#endif
}
- if (authsvc != STARTUP_MSG && authsvc != STARTUP_KRB5_MSG)
- snprintf(PQerrormsg, PQERRORMSG_LENGTH,
- libpq_gettext("fe_getauthname: invalid authentication system: %d\n"),
- authsvc);
-
authn = name ? strdup(name) : NULL;
pgunlock_thread();
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.h,v 1.22 2005/10/15 02:49:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.h,v 1.23 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq-int.h"
-/*----------------------------------------------------------------
- * Common routines and definitions
- *----------------------------------------------------------------
- */
-
-/* what we call "no authentication system" */
-#define UNAUTHNAME "unauth"
-
-/* what a frontend uses by default */
-#ifndef KRB5
-#define DEFAULT_CLIENT_AUTHSVC UNAUTHNAME
-#else
-#define DEFAULT_CLIENT_AUTHSVC "kerberos"
-#endif /* KRB5 */
-
-extern int fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
+extern int pg_fe_sendauth(AuthRequest areq, PGconn *conn, const char *hostname,
const char *password, char *PQerrormsg);
-extern MsgType fe_getauthsvc(char *PQerrormsg);
-extern void fe_setauthsvc(const char *name, char *PQerrormsg);
-extern char *fe_getauthname(char *PQerrormsg);
-
-#define PG_KRB5_VERSION "PGVER5.1" /* at most KRB_SENDAUTH_VLEN chars */
+extern char *pg_fe_getauthname(char *PQerrormsg);
#endif /* FE_AUTH_H */
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.322 2005/10/15 02:49:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.323 2005/10/17 16:24:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*
* The value for the username is treated specially in conninfo_parse.
* If the Compiled-in resource is specified as a NULL value, the
- * user is determined by fe_getauthname().
+ * user is determined by pg_fe_getauthname().
*
* The Label and Disp-Char entries are provided for applications that
* want to use PQconndefaults() to create a generic database connection
{
char service[NI_MAXHOST];
- getnameinfo_all(&conn->raddr.addr, conn->raddr.salen,
- NULL, 0,
- service, sizeof(service),
- NI_NUMERICSERV);
+ pg_getnameinfo_all(&conn->raddr.addr, conn->raddr.salen,
+ NULL, 0,
+ service, sizeof(service),
+ NI_NUMERICSERV);
printfPQExpBuffer(&conn->errorMessage,
- libpq_gettext(
- "could not connect to server: %s\n"
+ libpq_gettext("could not connect to server: %s\n"
"\tIs the server running locally and accepting\n"
- "\tconnections on Unix domain socket \"%s\"?\n"
- ),
+ "\tconnections on Unix domain socket \"%s\"?\n"),
SOCK_STRERROR(errorno, sebuf, sizeof(sebuf)),
service);
}
#endif /* HAVE_UNIX_SOCKETS */
{
printfPQExpBuffer(&conn->errorMessage,
- libpq_gettext(
- "could not connect to server: %s\n"
+ libpq_gettext("could not connect to server: %s\n"
"\tIs the server running on host \"%s\" and accepting\n"
- "\tTCP/IP connections on port %s?\n"
- ),
+ "\tTCP/IP connections on port %s?\n"),
SOCK_STRERROR(errorno, sebuf, sizeof(sebuf)),
conn->pghostaddr
? conn->pghostaddr
conn->outCount = 0;
/*
- * Determine the parameters to pass to getaddrinfo_all.
+ * Determine the parameters to pass to pg_getaddrinfo_all.
*/
/* Initialize hint structure */
#endif /* HAVE_UNIX_SOCKETS */
}
- /* Use getaddrinfo_all() to resolve the address */
- ret = getaddrinfo_all(node, portstr, &hint, &addrs);
+ /* Use pg_getaddrinfo_all() to resolve the address */
+ ret = pg_getaddrinfo_all(node, portstr, &hint, &addrs);
if (ret || !addrs)
{
if (node)
libpq_gettext("could not translate Unix-domain socket path \"%s\" to address: %s\n"),
portstr, gai_strerror(ret));
if (addrs)
- freeaddrinfo_all(hint.ai_family, addrs);
+ pg_freeaddrinfo_all(hint.ai_family, addrs);
goto connect_errReturn;
}
{
/*
* Try to initiate a connection to one of the addresses
- * returned by getaddrinfo_all(). conn->addr_cur is the next
- * one to try. We fail when we run out of addresses
+ * returned by pg_getaddrinfo_all(). conn->addr_cur is the
+ * next one to try. We fail when we run out of addresses
* (reporting the error returned for the *last* alternative,
* which may not be what users expect :-().
*/
* XXX fe-auth.c has not been fixed to support PQExpBuffers,
* so:
*/
- if (fe_sendauth(areq, conn, conn->pghost, conn->pgpass,
- conn->errorMessage.data) != STATUS_OK)
+ if (pg_fe_sendauth(areq, conn, conn->pghost, conn->pgpass,
+ conn->errorMessage.data) != STATUS_OK)
{
conn->errorMessage.len = strlen(conn->errorMessage.data);
goto error_return;
conn->errorMessage.len = strlen(conn->errorMessage.data);
/*
- * Just make sure that any data sent by fe_sendauth is flushed
- * out. Although this theoretically could block, it really
- * shouldn't since we don't send large auth responses.
+ * Just make sure that any data sent by pg_fe_sendauth is
+ * flushed out. Although this theoretically could block, it
+ * really shouldn't since we don't send large auth responses.
*/
if (pqFlush(conn))
goto error_return;
}
/* We can release the address list now. */
- freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
+ pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
conn->addrlist = NULL;
conn->addr_cur = NULL;
free(conn->krbsrvname);
#endif
/* Note that conn->Pfdebug is not ours to close or free */
- freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
+ pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
notify = conn->notifyHead;
while (notify != NULL)
{
* absent */
conn->asyncStatus = PGASYNC_IDLE;
pqClearAsyncResult(conn); /* deallocate result and curTuple */
- freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
+ pg_freeaddrinfo_all(conn->addrlist_family, conn->addrlist);
conn->addrlist = NULL;
conn->addr_cur = NULL;
notify = conn->notifyHead;
*/
if (strcmp(option->keyword, "user") == 0)
{
- option->val = fe_getauthname(errortmp);
+ option->val = pg_fe_getauthname(errortmp);
/* note any error message is thrown away */
continue;
}