1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Pgindent run for 8.0.

This commit is contained in:
Bruce Momjian
2004-08-29 05:07:03 +00:00
parent 90cb9c3051
commit b6b71b85bc
527 changed files with 20550 additions and 18283 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.117 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.118 2004/08/29 05:06:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -387,7 +387,7 @@ auth_failed(Port *port, int status)
errstr = gettext_noop("PAM authentication failed for user \"%s\"");
break;
#endif /* USE_PAM */
default :
default:
errstr = gettext_noop("Unknown auth method: authentication failed for user \"%s\"");
break;
}
@@ -473,6 +473,7 @@ ClientAuthentication(Port *port)
break;
case uaIdent:
/*
* If we are doing ident on unix-domain sockets, use SCM_CREDS
* only if it is defined and SO_PEERCRED isn't.
@@ -483,6 +484,7 @@ ClientAuthentication(Port *port)
if (port->raddr.addr.ss_family == AF_UNIX)
{
#if defined(HAVE_STRUCT_FCRED) || defined(HAVE_STRUCT_SOCKCRED)
/*
* Receive credentials on next message receipt, BSD/OS,
* NetBSD. We need to set this before the client sends the
@@ -493,7 +495,7 @@ ClientAuthentication(Port *port)
if (setsockopt(port->sock, 0, LOCAL_CREDS, &on, sizeof(on)) < 0)
ereport(FATAL,
(errcode_for_socket_access(),
errmsg("could not enable credential reception: %m")));
errmsg("could not enable credential reception: %m")));
#endif
sendAuthRequest(port, AUTH_REQ_SCM_CREDS);
@@ -770,8 +772,8 @@ recv_password_packet(Port *port)
if (mtype != EOF)
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("expected password response, got message type %d",
mtype)));
errmsg("expected password response, got message type %d",
mtype)));
return NULL; /* EOF or bad message type */
}
}

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/be-fsstubs.c,v 1.73 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/be-fsstubs.c,v 1.74 2004/08/29 05:06:43 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -507,8 +507,8 @@ AtEOXact_LargeObject(bool isCommit)
currentContext = MemoryContextSwitchTo(fscxt);
/*
* Close LO fds and clear cookies array so that LO fds are no longer good.
* On abort we skip the close step.
* Close LO fds and clear cookies array so that LO fds are no longer
* good. On abort we skip the close step.
*/
for (i = 0; i < cookies_size; i++)
{
@@ -536,7 +536,7 @@ AtEOXact_LargeObject(bool isCommit)
/*
* AtEOSubXact_LargeObject
* Take care of large objects at subtransaction commit/abort
* Take care of large objects at subtransaction commit/abort
*
* Reassign LOs created/opened during a committing subtransaction
* to the parent transaction. On abort, just close them.
@@ -545,7 +545,7 @@ void
AtEOSubXact_LargeObject(bool isCommit, TransactionId myXid,
TransactionId parentXid)
{
int i;
int i;
if (fscxt == NULL) /* no LO operations in this xact */
return;
@@ -561,8 +561,8 @@ AtEOSubXact_LargeObject(bool isCommit, TransactionId myXid,
else
{
/*
* Make sure we do not call inv_close twice if it errors out
* for some reason. Better a leak than a crash.
* Make sure we do not call inv_close twice if it errors
* out for some reason. Better a leak than a crash.
*/
deleteLOfd(i);
inv_close(lo);

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.47 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.48 2004/08/29 05:06:43 momjian Exp $
*
* Since the server static private key ($DataDir/server.key)
* will normally be stored unencrypted so that the database
@@ -294,7 +294,7 @@ rloop:
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("unrecognized SSL error code %d",
SSL_get_error(port->ssl, n))));
SSL_get_error(port->ssl, n))));
n = -1;
break;
}
@@ -379,7 +379,7 @@ wloop:
ereport(COMMERROR,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("unrecognized SSL error code %d",
SSL_get_error(port->ssl, n))));
SSL_get_error(port->ssl, n))));
n = -1;
break;
}
@@ -546,8 +546,8 @@ tmp_dh_cb(SSL *s, int is_export, int keylength)
if (r == NULL || 8 * DH_size(r) < keylength)
{
ereport(DEBUG2,
(errmsg_internal("DH: generating parameters (%d bits)....",
keylength)));
(errmsg_internal("DH: generating parameters (%d bits)....",
keylength)));
r = DH_generate_parameters(keylength, DH_GENERATOR_2, NULL, NULL);
}
@@ -651,13 +651,13 @@ initialize_SSL(void)
errmsg("could not access private key file \"%s\": %m",
fnbuf)));
/*
/*
* Require no public access to key file.
*
* XXX temporarily suppress check when on Windows, because there may
* not be proper support for Unix-y file permissions. Need to think
* of a reasonable check to apply on Windows. (See also the data
* directory permission check in postmaster.c)
* not be proper support for Unix-y file permissions. Need to
* think of a reasonable check to apply on Windows. (See also the
* data directory permission check in postmaster.c)
*/
#if !defined(__CYGWIN__) && !defined(WIN32)
if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IRWXG | S_IRWXO)) ||

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.128 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.129 2004/08/29 05:06:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -41,10 +41,10 @@
/* Max size of username ident server can return */
#define IDENT_USERNAME_MAX 512
/* Standard TCP port number for Ident service. Assigned by IANA */
/* Standard TCP port number for Ident service. Assigned by IANA */
#define IDENT_PORT 113
/* Name of the config file */
/* Name of the config file */
#define CONF_FILE "pg_hba.conf"
/* Name of the usermap file */
@@ -66,17 +66,20 @@
*/
/* pre-parsed content of CONF_FILE and corresponding line #s */
static List *hba_lines = NIL;
static List *hba_line_nums = NIL;
static List *hba_lines = NIL;
static List *hba_line_nums = NIL;
/* pre-parsed content of USERMAP_FILE and corresponding line #s */
static List *ident_lines = NIL;
static List *ident_line_nums = NIL;
static List *ident_lines = NIL;
static List *ident_line_nums = NIL;
/* pre-parsed content of group file and corresponding line #s */
static List *group_lines = NIL;
static List *group_line_nums = NIL;
static List *group_lines = NIL;
static List *group_line_nums = NIL;
/* pre-parsed content of user passwd file and corresponding line #s */
static List *user_lines = NIL;
static List *user_line_nums = NIL;
static List *user_lines = NIL;
static List *user_line_nums = NIL;
/* sorted entries so we can do binary search lookups */
static List **user_sorted = NULL; /* sorted user list, for bsearch() */
@@ -119,7 +122,7 @@ next_token(FILE *fp, char *buf, int bufsz)
char *end_buf = buf + (bufsz - 2);
bool in_quote = false;
bool was_quote = false;
bool saw_quote = false;
bool saw_quote = false;
Assert(end_buf > start_buf);
@@ -134,8 +137,8 @@ next_token(FILE *fp, char *buf, int bufsz)
}
/*
* Build a token in buf of next characters up to EOF, EOL,
* unquoted comma, or unquoted whitespace.
* Build a token in buf of next characters up to EOF, EOL, unquoted
* comma, or unquoted whitespace.
*/
while (c != EOF && c != '\n' &&
(!pg_isblank(c) || in_quote == true))
@@ -156,8 +159,8 @@ next_token(FILE *fp, char *buf, int bufsz)
*buf = '\0';
ereport(LOG,
(errcode(ERRCODE_CONFIG_FILE_ERROR),
errmsg("authentication file token too long, skipping: \"%s\"",
start_buf)));
errmsg("authentication file token too long, skipping: \"%s\"",
start_buf)));
/* Discard remainder of line */
while ((c = getc(fp)) != EOF && c != '\n')
;
@@ -195,10 +198,10 @@ next_token(FILE *fp, char *buf, int bufsz)
*buf = '\0';
if (!saw_quote &&
(strcmp(start_buf, "all") == 0 ||
strcmp(start_buf, "sameuser") == 0 ||
strcmp(start_buf, "samegroup") == 0))
if (!saw_quote &&
(strcmp(start_buf, "all") == 0 ||
strcmp(start_buf, "sameuser") == 0 ||
strcmp(start_buf, "samegroup") == 0))
{
/* append newline to a magical keyword */
*buf++ = '\n';
@@ -270,10 +273,10 @@ free_lines(List **lines, List **line_nums)
if (*lines)
{
/*
* "lines" is a list of lists; each of those sublists consists
* of palloc'ed tokens, so we want to free each pointed-to
* token in a sublist, followed by the sublist itself, and
* finally the whole list.
* "lines" is a list of lists; each of those sublists consists of
* palloc'ed tokens, so we want to free each pointed-to token in a
* sublist, followed by the sublist itself, and finally the whole
* list.
*/
ListCell *line;
@@ -338,8 +341,8 @@ tokenize_inc_file(const char *inc_filename)
/* Create comma-separate string from List */
foreach(line, inc_lines)
{
List *token_list = (List *) lfirst(line);
ListCell *token;
List *token_list = (List *) lfirst(line);
ListCell *token;
foreach(token, token_list)
{
@@ -455,7 +458,7 @@ get_group_line(const char *group)
/*
* Lookup a user name in the pg_shadow file
*/
List **
List **
get_user_line(const char *user)
{
/* On some versions of Solaris, bsearch of zero items dumps core */
@@ -480,7 +483,7 @@ check_group(char *group, char *user)
if ((line = get_group_line(group)) != NULL)
{
ListCell *line_item;
ListCell *line_item;
/* skip over the group name */
for_each_cell(line_item, lnext(list_head(*line)))
@@ -792,9 +795,9 @@ parse_hba(List *line, int line_num, hbaPort *port,
if (addr.ss_family != port->raddr.addr.ss_family)
{
/*
* Wrong address family. We allow only one case: if the
* file has IPv4 and the port is IPv6, promote the file
* address to IPv6 and try to match that way.
* Wrong address family. We allow only one case: if the file
* has IPv4 and the port is IPv6, promote the file address to
* IPv6 and try to match that way.
*/
#ifdef HAVE_IPV6
if (addr.ss_family == AF_INET &&
@@ -804,7 +807,7 @@ parse_hba(List *line, int line_num, hbaPort *port,
promote_v4_to_v6_mask(&mask);
}
else
#endif /* HAVE_IPV6 */
#endif /* HAVE_IPV6 */
{
/* Line doesn't match client port, so ignore it. */
return;
@@ -846,8 +849,8 @@ hba_syntax:
else
ereport(LOG,
(errcode(ERRCODE_CONFIG_FILE_ERROR),
errmsg("missing field in pg_hba.conf file at end of line %d",
line_num)));
errmsg("missing field in pg_hba.conf file at end of line %d",
line_num)));
/* Come here if suitable message already logged */
hba_other_error:
@@ -1041,7 +1044,8 @@ load_hba(void)
conf_file = pstrdup(guc_hbafile);
else
{
char *confloc = (user_pgconfig_is_dir) ? user_pgconfig : DataDir;
char *confloc = (user_pgconfig_is_dir) ? user_pgconfig : DataDir;
/* put together the full pathname to the config file */
conf_file = palloc(strlen(confloc) + strlen(CONF_FILE) + 2);
sprintf(conf_file, "%s/%s", confloc, CONF_FILE);
@@ -1160,7 +1164,8 @@ check_ident_usermap(const char *usermap_name,
}
else
{
ListCell *line_cell, *num_cell;
ListCell *line_cell,
*num_cell;
forboth(line_cell, ident_lines, num_cell, ident_line_nums)
{
@@ -1184,6 +1189,7 @@ load_ident(void)
FILE *file; /* The map file we have to read */
char *map_file; /* The name of the map file we have to
* read */
if (ident_lines || ident_line_nums)
free_lines(&ident_lines, &ident_line_nums);
@@ -1193,11 +1199,12 @@ load_ident(void)
else
{
/* put together the full pathname to the map file */
char *confloc = (user_pgconfig_is_dir) ? user_pgconfig : DataDir;
char *confloc = (user_pgconfig_is_dir) ? user_pgconfig : DataDir;
map_file = (char *) palloc(strlen(confloc) + strlen(USERMAP_FILE) + 2);
sprintf(map_file, "%s/%s", confloc, USERMAP_FILE);
}
file = AllocateFile(map_file, "r");
if (file == NULL)
{
@@ -1225,7 +1232,7 @@ static bool
interpret_ident_response(const char *ident_response,
char *ident_user)
{
const char *cursor = ident_response; /* Cursor into
const char *cursor = ident_response; /* Cursor into
* *ident_response */
/*
@@ -1353,7 +1360,8 @@ ident_inet(const SockAddr remote_addr,
hints.ai_addr = NULL;
hints.ai_next = NULL;
rc = getaddrinfo_all(remote_addr_s, ident_port, &hints, &ident_serv);
if (rc || !ident_serv) {
if (rc || !ident_serv)
{
if (ident_serv)
freeaddrinfo_all(hints.ai_family, ident_serv);
return false; /* we don't expect this to happen */
@@ -1368,7 +1376,8 @@ ident_inet(const SockAddr remote_addr,
hints.ai_addr = NULL;
hints.ai_next = NULL;
rc = getaddrinfo_all(local_addr_s, NULL, &hints, &la);
if (rc || !la) {
if (rc || !la)
{
if (la)
freeaddrinfo_all(hints.ai_family, la);
return false; /* we don't expect this to happen */
@@ -1453,8 +1462,8 @@ ident_inet(const SockAddr remote_addr,
ident_return = interpret_ident_response(ident_response, ident_user);
if (!ident_return)
ereport(LOG,
(errmsg("invalidly formatted response from Ident server: \"%s\"",
ident_response)));
(errmsg("invalidly formatted response from Ident server: \"%s\"",
ident_response)));
ident_inet_done:
if (sock_fd >= 0)

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.27 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.28 2004/08/29 05:06:43 momjian Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -34,8 +34,8 @@
#endif
#include <arpa/inet.h>
#include <sys/file.h>
#endif /* !defined(_MSC_VER) && !defined(__BORLANDC__) */
#endif /* !defined(_MSC_VER) &&
* !defined(__BORLANDC__) */
#include "libpq/ip.h"
@@ -67,7 +67,7 @@ static int getnameinfo_unix(const struct sockaddr_un * sa, int salen,
*/
int
getaddrinfo_all(const char *hostname, const char *servname,
const struct addrinfo *hintp, struct addrinfo **result)
const struct addrinfo * hintp, struct addrinfo ** result)
{
/* not all versions of getaddrinfo() zero *result on failure */
*result = NULL;
@@ -269,7 +269,6 @@ getnameinfo_unix(const struct sockaddr_un * sa, int salen,
return 0;
}
#endif /* HAVE_UNIX_SOCKETS */
@@ -328,7 +327,6 @@ rangeSockAddrAF_INET6(const struct sockaddr_in6 * addr,
return 1;
}
#endif
/*
@@ -472,4 +470,4 @@ promote_v4_to_v6_mask(struct sockaddr_storage * addr)
memcpy(addr, &addr6, sizeof(addr6));
}
#endif /* HAVE_IPV6 */
#endif /* HAVE_IPV6 */

View File

@@ -30,7 +30,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.170 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.171 2004/08/29 05:06:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -307,7 +307,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
{
ereport(LOG,
(errcode_for_socket_access(),
/* translator: %s is IPv4, IPv6, or Unix */
/* translator: %s is IPv4, IPv6, or Unix */
errmsg("could not create %s socket: %m",
familyDesc)));
continue;
@@ -352,7 +352,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
{
ereport(LOG,
(errcode_for_socket_access(),
/* translator: %s is IPv4, IPv6, or Unix */
/* translator: %s is IPv4, IPv6, or Unix */
errmsg("could not bind %s socket: %m",
familyDesc),
(IS_AF_UNIX(addr->ai_family)) ?
@@ -392,7 +392,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
{
ereport(LOG,
(errcode_for_socket_access(),
/* translator: %s is IPv4, IPv6, or Unix */
/* translator: %s is IPv4, IPv6, or Unix */
errmsg("could not listen on %s socket: %m",
familyDesc)));
closesocket(fd);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/pqsignal.c,v 1.36 2004/08/29 04:12:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/libpq/pqsignal.c,v 1.37 2004/08/29 05:06:43 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -50,6 +50,7 @@
sigset_t UnBlockSig,
BlockSig,
AuthBlockSig;
#else
int UnBlockSig,
BlockSig,
@@ -169,4 +170,4 @@ pqsignal(int signo, pqsigfunc func)
#endif /* !HAVE_POSIX_SIGNALS */
}
#endif /* WIN32 */
#endif /* WIN32 */